generic linked list functional, we need to test with valgrind memory