updated views, controllers  and algorithm