Made some changes to allow for a page stack