fixed errors, added AI that still has issues