Adding code for sorted linked list