refactoring ai code
progress save...minimax method last to refactor