updates to controller, refactored model