Extracted the Minimax to an own extension
Correct solution