fixed graph and moved towards MVC format