improvement to gs_paginatin()