Create paginate to project
Change count function
Rearrage code