changed structure of program to work with AI and players, implemented controller class