updating pagination code to new markup