Not only this, but banks were in the habit of ordering your account activity on a day-by-day basis so as to maximize your fee liability, a practice which cast Bank of America some $400 million a few years back and which Wells Fargo is trying to escape responsibility for at present through some other litigation strategy: https://consumerist.com/2011/07/14/bank-of-america-paying-ou...
It even happened that one day I had a withdrawal, and a deposit. Overnight, the bank first processed the withdrawal (account balance became negative), next added the deposit (balance became positive again). Then charged me the $35 fee! They could have done it the other way around and not charge for it....