Trying to improve  AI, but now it's not working properly