C code for LinkedList