todo function exercise with working writeFile function