Adding file reading logic