implementing alpha beta pruning