minmax with alpha-beta pruning