added file reading functionality