implemented alpha beta pruning