Worked on AI, fixed some bugs