Created linkedlist function.