Adding exercise of writing to file