void WriteRawResults()
    {
        StringWriter OutStr = new StringWriter();

        OutStr.WriteLine((EDivision)(CurDivIndex) + " " + (ERound)(CurRoundIndex) + " Results");
        List <PoolData> Pools = Global.AllData.AllDivisions[CurDivIndex].Rounds[CurRoundIndex].Pools;

        foreach (PoolData pd in Pools)
        {
            OutStr.WriteLine("Pool " + pd.PoolName);
            string CatHeaders   = "\t";
            string JudgeHeaders = "\t";
            if (pd.Teams.Count > 0)
            {
                for (int i = 0; i < pd.Teams[0].Data.RoutineScores.AIResults.Count; ++i)
                {
                    if (i == 0)
                    {
                        CatHeaders += "AI";
                    }
                    CatHeaders   += "\t";
                    JudgeHeaders += NameDatabase.FindInDatabase(pd.Teams[0].Data.RoutineScores.AIResults[i].JudgeNameId).DisplayName + "\t";
                }
                for (int i = 0; i < pd.Teams[0].Data.RoutineScores.ExResults.Count; ++i)
                {
                    if (i == 0)
                    {
                        CatHeaders += "Ex";
                    }
                    CatHeaders   += "\t";
                    JudgeHeaders += NameDatabase.FindInDatabase(pd.Teams[0].Data.RoutineScores.ExResults[i].JudgeNameId).DisplayName + "\t";
                }
                for (int i = 0; i < pd.Teams[0].Data.RoutineScores.DiffResults.Count; ++i)
                {
                    if (i == 0)
                    {
                        CatHeaders += "Diff";
                    }
                    CatHeaders   += "\t";
                    JudgeHeaders += NameDatabase.FindInDatabase(pd.Teams[0].Data.RoutineScores.DiffResults[i].JudgeNameId).DisplayName + "\t";
                }
            }
            OutStr.WriteLine(CatHeaders);
            OutStr.WriteLine(JudgeHeaders + "\tTotal\tRank");

            int TeamNum = 1;
            foreach (TeamDataDisplay tdd in pd.Teams)
            {
                string TeamStr = TeamNum + ": " + tdd.Data.PlayerNames + "\t";
                foreach (AIData aid in tdd.Data.RoutineScores.AIResults)
                {
                    TeamStr += aid.GetTotalPoints() + "\t";
                }
                foreach (ExData ed in tdd.Data.RoutineScores.ExResults)
                {
                    TeamStr += ed.GetTotalPoints() + "\t";
                }
                foreach (DiffData dd in tdd.Data.RoutineScores.DiffResults)
                {
                    TeamStr += dd.GetTotalPoints() + "\t";
                }
                OutStr.WriteLine(TeamStr + "\t" + tdd.Data.RoutineScores.GetTotalPoints() + "\t" + GetTeamPlace(pd.Teams, tdd));
                ++TeamNum;
            }

            OutStr.WriteLine();
            OutStr.WriteLine();

            if (pd.Teams.Count > 0)
            {
                int ResultsIndex = 0;
                foreach (AIData aid in pd.Teams[0].Data.RoutineScores.AIResults)
                {
                    string AIHeader = (EDivision)(CurDivIndex) + " " + (ERound)(CurRoundIndex) + " Results\tArtistic Impression\t" +
                                      "Pool " + pd.PoolName + "\t" + NameDatabase.FindInDatabase(aid.JudgeNameId).DisplayName;
                    OutStr.WriteLine(AIHeader);
                    OutStr.WriteLine("\tVariety\tTeamwork\tMusic\tFlow\tForm\tGeneral Impression\tTotal\tRank");
                    int TeamIndex = 1;
                    foreach (TeamDataDisplay tdd in pd.Teams)
                    {
                        if (ResultsIndex < tdd.Data.RoutineScores.AIResults.Count)
                        {
                            AIData Data = tdd.Data.RoutineScores.AIResults[ResultsIndex];
                            int    Rank = 1;
                            foreach (TeamDataDisplay OtherTdd in pd.Teams)
                            {
                                if (ResultsIndex < OtherTdd.Data.RoutineScores.AIResults.Count &&
                                    OtherTdd.Data.RoutineScores.AIResults[ResultsIndex].GetTotalPoints() > Data.GetTotalPoints())
                                {
                                    ++Rank;
                                }
                            }

                            string TeamStr = TeamIndex + ": " + tdd.Data.PlayerNames + "\t" + Data.Variety + "\t" + Data.Teamwork + "\t" +
                                             Data.Music + "\t" + Data.Flow + "\t" + Data.Form + "\t" + Data.General + "\t" + Data.GetTotalPoints() + "\t" + Rank;

                            OutStr.WriteLine(TeamStr);
                            ++TeamIndex;
                        }
                    }

                    ++ResultsIndex;
                    OutStr.WriteLine();
                }

                OutStr.WriteLine();

                ResultsIndex = 0;
                foreach (ExData ed in pd.Teams[0].Data.RoutineScores.ExResults)
                {
                    string ExHeader = (EDivision)(CurDivIndex) + " " + (ERound)(CurRoundIndex) + " Results\tExecution\t" +
                                      "Pool " + pd.PoolName + "\t" + NameDatabase.FindInDatabase(ed.JudgeNameId).DisplayName;
                    OutStr.WriteLine(ExHeader);
                    OutStr.WriteLine("\t.1\t.2\t.3\t.5\tTotal\tRank");
                    int TeamIndex = 1;
                    foreach (TeamDataDisplay tdd in pd.Teams)
                    {
                        if (ResultsIndex < tdd.Data.RoutineScores.ExResults.Count)
                        {
                            ExData Data = tdd.Data.RoutineScores.ExResults[ResultsIndex];
                            int    Rank = 1;
                            foreach (TeamDataDisplay OtherTdd in pd.Teams)
                            {
                                if (ResultsIndex < OtherTdd.Data.RoutineScores.ExResults.Count &&
                                    OtherTdd.Data.RoutineScores.ExResults[ResultsIndex].GetTotalPoints() > Data.GetTotalPoints())
                                {
                                    ++Rank;
                                }
                            }

                            string TeamStr = TeamIndex + ": " + tdd.Data.PlayerNames + "\t" + Data.Point1Count + "\t" + Data.Point2Count + "\t" +
                                             Data.Point3Count + "\t" + Data.Point5Count + "\t" + Data.GetTotalPoints() + "\t" + Rank;

                            OutStr.WriteLine(TeamStr);
                            ++TeamIndex;
                        }
                    }

                    ++ResultsIndex;
                    OutStr.WriteLine();
                }

                OutStr.WriteLine();

                ResultsIndex = 0;
                foreach (DiffData dd in pd.Teams[0].Data.RoutineScores.DiffResults)
                {
                    string ExHeader = (EDivision)(CurDivIndex) + " " + (ERound)(CurRoundIndex) + " Results\tDifficulty\t" +
                                      "Pool " + pd.PoolName + "\t" + NameDatabase.FindInDatabase(dd.JudgeNameId).DisplayName;
                    OutStr.WriteLine(ExHeader);
                    string BlockHeader = "\t";
                    for (int i = 0; i < dd.NumScores; ++i)
                    {
                        BlockHeader += (i + 1) + "\t";
                    }
                    OutStr.WriteLine(BlockHeader + "Total\tRank");
                    int TeamIndex = 1;
                    foreach (TeamDataDisplay tdd in pd.Teams)
                    {
                        if (ResultsIndex < tdd.Data.RoutineScores.DiffResults.Count)
                        {
                            DiffData Data = tdd.Data.RoutineScores.DiffResults[ResultsIndex];
                            int      Rank = 1;
                            foreach (TeamDataDisplay OtherTdd in pd.Teams)
                            {
                                if (ResultsIndex < OtherTdd.Data.RoutineScores.DiffResults.Count &&
                                    OtherTdd.Data.RoutineScores.DiffResults[ResultsIndex].GetTotalPoints() > Data.GetTotalPoints())
                                {
                                    ++Rank;
                                }
                            }

                            string TeamStr = TeamIndex + ": " + tdd.Data.PlayerNames + "\t";
                            for (int i = 0; i < Data.NumScores; ++i)
                            {
                                TeamStr += Data.DiffScores[i] + "\t";
                            }
                            TeamStr += Data.GetTotalPoints() + "\t" + Rank;
                            OutStr.WriteLine(TeamStr);
                            ++TeamIndex;
                        }
                    }

                    ++ResultsIndex;
                    OutStr.WriteLine();
                }
            }
        }

        string TempFilePath = Application.persistentDataPath + "/TempExcelStr.txt";

        if (File.Exists(TempFilePath))
        {
            File.Delete(TempFilePath);
        }
        StreamWriter TempFile = new StreamWriter(TempFilePath);

        TempFile.Write(OutStr.ToString());
        TempFile.Close();
        OutStr.Close();

        TempFilePath = TempFilePath.Replace('/', '\\');

        if (File.Exists(ExcelPath))
        {
            Process.Start(ExcelPath, "\"" + TempFilePath + "\"");
        }
    }
    // Update is called once per frame
    new void Update()
    {
        if (bIsDrawingEditingTeams)
        {
            return;
        }

        base.Update();

        int JustFinishedIndex = Mathf.Min((int)(HeaderDrawer.RoutineTime / 15f) - 1, GetNumScoreBlocks() - 1);

        if (JustFinishedIndex >= 0 && NSArray[JustFinishedIndex].NumberValue == 0)
        {
            if (RecordScoreIndex != JustFinishedIndex)
            {
                GetComponent <AudioSource>().clip = MarkAudioClips[JustFinishedIndex];
                GetComponent <AudioSource>().Play();
            }

            RecordScoreIndex = JustFinishedIndex;
        }
        else
        {
            RecordScoreIndex = -1;
        }

        if (bIsJudging && !GetComponent <AudioSource>().isPlaying&& !bPlayedEndClip && RecordScoreIndex == GetNumScoreBlocks() - 1)
        {
            bPlayedEndClip = true;
            GetComponent <AudioSource>().clip = EndAudioClip;
            GetComponent <AudioSource>().Play();
        }

        foreach (NumberScroll ns in NSArray)
        {
            ns.bAnimating = false;
        }

        if (RecordScoreIndex != -1)
        {
            NSArray[RecordScoreIndex].bAnimating = true;
        }

        InputingConsecCooldown -= Time.deltaTime;
        if (!bInputingConsec && InputingConsecCooldown < 0)
        {
            MousePos   = Input.mousePosition;
            MousePos.y = Screen.height - MousePos.y;
            if (Input.GetMouseButtonDown(0) || (Input.GetMouseButton(0) && bInputingDiffScore))
            {
                if (NumberLineRect.Contains(MousePos) && MousePos.y > Screen.height * .78f || bInputingDiffScore)
                {
                    bInputingDiffScore = true;

                    CurrentDiffScore = Mathf.Clamp((MousePos.x - NumberLineRect.x - .0488f * NumberLineWidth) / (NumberLineWidth * .8984f), 0f, 1f) * 10f;
                    CurrentDiffScore = Mathf.Round(CurrentDiffScore / DiffScoreSnap) * DiffScoreSnap;
                }
            }
            else
            {
                if (bInputingDiffScore)
                {
                    if (RecordScoreIndex != -1)
                    {
                        NSArray[RecordScoreIndex].NumberValue = CurrentDiffScore;
                    }

                    RecordScoreConsecIndex = RecordScoreIndex;
                    bInputingConsec        = true;
                }

                bInputingDiffScore = false;
            }
        }

        for (int i = 0; i < GetNumScoreBlocks(); ++i)
        {
            NSArray[i].Update();

            if (CurData != null)
            {
                if (CurData.DiffScores[i] != NSArray[i].NumberValue && !NSArray[i].IsPicking)
                {
                    CurData.DiffScores[i] = NSArray[i].NumberValue;

                    BackupCurrentData();
                }
            }

            if (NSArray[i].bEditing)
            {
                bInputingConsec        = true;
                RecordScoreConsecIndex = i;
            }
        }

        int NumBlocks = GetNumScoreBlocks();

        for (int i = 0; i < 20; ++i)
        {
            NumberBoxesList[i].SetActive(i < NumBlocks);
            LabelList[i].SetActive(i < NumBlocks);
        }

        if (CurData != null)
        {
            TotalScoreUI.GetComponent <Text>().text = CurData.GetTotalPoints().ToString("0.0");
        }
    }