balance = balance;

Totally pointless, get rid of it.

maxBalance = maxBalance;

Ditto.

I'm confused. You managed to write the deposit and maxBalance code but cannot write the withdrawal and...