Added file reading function