more sensible file reading