Restructured code to MVC format - not currently functional