fixed AI, now it's working, but solution needs to be better. fix it later