Updated comments in controller to better explain the functions