adding changes to control.py