Need help implementing burn logic

Hi everyone,

I'm working on an ERC-20 token that burns 5% of every transaction from the total supply. See below:

1.) I realize the burn logic has to be called in the transfer function. Did I implement that correctly here?

2.) Could someone give an overview of the burn functions and perhaps provide some guidance on how sound they are?

Thank you

This does not look good. You're burning the entire amount as opposed to the "burn amount" that you calculated but discarded.