removed saveToFile method.