finished the sorting behavihour & functionality.