added test for writing to test.txt