Adjustments to controller.py