added remaining balance function