added some small things, started with making of function to write away the data