Implementing WriteSetToFile method.