Finish the controller code