changed way of creating text file