implement table view sorting, fix comparator interface