implements alpha beta pruning
simple refactoring of ai