Added more functionality for the controller.