added paging to all index types, created utility function for paging. Fixed some formatting issues.