sortList() is working,
might something in rest of LinkedList can be wrong
(I suppose you wrote your own LinkedList class)