Created a macro to deal with the construction of the pagination url