fixed redirection to wrong url of links and added comments to controller and model files