edited controller.py