Updated pagination

Updated the javascript required for pagination.