All specs are working.
Refactored minimax method.