added file reading and extracting methods