updated balance function and commented out