Implement balance function