Added pagination and some stuff to report generation.