added table sorting function; started work on adding caret symbols to column headers