Paging directive added

This directive is slightly modified as per requirement.
Pagination code is added as per requirement.