added some cosmetic changes
fixed pagination