MakeNode function to create a linked list