oppg 2.2 writing to text file