Read to file and write to file functions added