patched bugs described on piazza, first draft of page.cpp (uncompiled/untested)