adds the first two steps of file IO