add sorter
some fixes