working reader for files