add read, write and create file functions