Not working using TreeSort, going to try with PriorityQueue