Minimax-algorithm implemented