Added saveFile method