basic paginator  implementation