some debugging and improving my AI