added pagination to blogs; made changePage function more modular