refactored AI Logic to return coordinates or false