added code for file reading