Improved DummyAI, generalized functions for AI