Wrote function to store pageTree in set of last 3 pages

Has not yet been tested as is, but the individual pieces have been
checked on my system.