Adding pagination to the html output