Added full functionality for the balance test