I'm currently stuck on a spot in my code. I need to write data to a text file, I have sorts going and they are taking the time that each sort takes to complete and then puts them into a txt file that I can then use to create graphs. Problem is that I just get one line after I run the program. I can't get it to keep each result.

```
public static void resultsToFile(String sort, double seconds, File file)
{
    try (PrintWriter out = new PrintWriter(new FileWriter(file)))
    {
        out.write(sort + "\t"); 
        out.write(seconds + " seconds\n");
        out.flush();
        out.close();

    }catch (IOException e)
    {
        e.printStackTrace();
    }   
}

```

This is what I have so far for my writing to files method. Any help would be greatly appreciated!