start on AI, fixed bugs