built the view per page functionality