refactored minimax and added pruning