moved minimax code to separate package