Fixed func balance logic, updated comments