Added debug statement and ordering of list
added test
added code for test, test has issues though:
added tests and code
added test for paging
added more paging