Added code to read pages into memory.