refactoring table sorting into class
table sorter not really working
working but ugly table sorting