Changed the paging to show all available pages to chose from

changed the logic on the pagification by adding total_pages and a for
loop