Added total balance calculation