added methods to controller and views