Implemented some of the controller functions