private static bool nameIsUnique(string name, ref List<Track> trackList, bool ignoreFirstOccurrence) { foreach (Track t in trackList) { if (t.TrackName == name) { if (ignoreFirstOccurrence) ignoreFirstOccurrence = false; else return false; } }//end check if unique return true; }