added backwards pagination and edge control for pages