Added totalling functionality for different accounts, and fixed type mismatch for the get_amount function