public static String addScore(String fileName, String username, long win, long lose) throws IOException
  {//System.out.println("addScore");
    Scanner scan;
    String[] usernames;
    long[] wins, losses;
    int fileLength = 0;

    username = fixName(username);

    try
    {
      scan = new Scanner(new File(fileName));
    }
    catch (FileNotFoundException ex)
    {
      System.err.println("File not found: " + fileName);
//      return "File not found: " + fileName;

      FileWriter writeToFile = new FileWriter(fileName);
      writeToFile.write("//BEGIN\r\n" + "//END");
      writeToFile.close();

      scan = new Scanner(new File(fileName));
    }

    String fileContents = "", fileLine = scan.nextLine();
    while (!fileLine.equals("//END")) //First sweep gets the length of the file
    {
      fileLine = scan.nextLine();
      if (!fileLine.equals("//END"))
        fileLength++;
    }

    usernames = new String[fileLength];
    wins = new long[fileLength];
    losses = new long[fileLength];

    scan = new Scanner(new File(fileName)); //RESET THE SCANNER FOR THE SECOND SWEEP
    String spare = scan.next();

    int i;
    for (i = 0; i < fileLength; i++) //Second sweep makes arrays of all values
    {
      try
      {
        usernames[i] = scan.next();
        //System.out.print(usernames[i]);
        wins[i] = scan.nextLong();
        //System.out.print(wins[i]);
        losses[i] = scan.nextLong();
        //System.out.println(losses[i]);
      }
      catch (InputMismatchException ex)
      {
        if (YesNoBox.bool(
        "Unexpected glitch when reading " + usernames[i] + "'s scores\nThey may not be present.\n"
        + "Would you like to reset " + usernames[i] + "'s scores in the file \"" + fileName + "\" to 0 wins and 0 losses?\n\n"
        + "(NOTE: The file is corrupt and the program you are trying to use may not work without resetting these scores. It is reccommended that you click Yes)",
                          "Error from GameScore", YesNoBox.ERROR))
        {
          wins[i] = 0;
          losses[i] = 0;
        }
        else
          JOptionPane.showMessageDialog(null, "CAUTION: This program may not work if this file is corrupt. You are warned.", "WARNING from GameScore", 0);
      }
    }

    for (i = 0; i < fileLength; i++)
    {
      if (usernames[i].equalsIgnoreCase(username))
      {
        System.err.println("Username \"" + username + "\" already exists.");
        return ("Username \"" + username + "\" already exists.");
      }
    }


    for (i = 0; i < fileLength; i++)
    {
      fileContents += usernames[i] + "\t" + wins[i] + " " + losses[i] + "\r\n";
    }

    fileContents += username + "\t" + win + " " + lose + "\r\n";

    //System.out.println(fileContents);
    FileWriter writeToFile = new FileWriter(fileName);
    FileWriter addToFile = new FileWriter(fileName, true);
    writeToFile.write("//BEGIN\r\n" + fileContents + "//END");
    writeToFile.close();
    return ("Score successfully added.");
  }//END addScore METHOD