implemented sortedLinkedList