Added function description in the controller, sort function in the contorller