added more tests for TableOrder and restructed