calculate current balance