Adding the controller code.