working on sort logic, does not work yet
FIXED THE SORTING! HOORAY