Added more logic to pagination - partial logic in place.