first draft of file reading functionality