Writes list to file

Updated to write the alphabetised list to file.