all needed methods to create and write data to file