rewriting the controller a little
resolved conflict with merge