Code cleaned up Added pagination

refactored code to get rid of duplication.  Added paginated view so
users see records 20 at a time