Added simple AI

Added simple AI
Refactor