added writeToFile method