tests for sorting tables refactored, unnecessary tests removed