Edit: balancing.py