Added basic AI code