Added pagination controls to the template