Model to controller stuff

Some of the functions that were moved out of the controller needed to have stuff taken out of them and put in the controller first.