finished the calculating balance feature