Modified classes to implement ai. Simple ai is already implmented.