Added File read/write logic