fixed the sorting
sth works
work to this pt
some basic functionality works