Added comments to control.py and cleaned up deprecated code