Worked on writeFile