getting ready to paginate and search