rough version of read files and pages