continued working on writefile