write my own pagination class and working on homepage