refactored functions into methods and changed some object constructors. Working on MVC next.