working on file read function