Implement and test minimax