merged controller and view and debugged