fixes to minmax: fixed while loop and alpha\beta pruning