organized program into the MVC pattern