invertPageOrder functionality implemented, tests pass