add linear sorter code