Revised removePages()