Implementing generic linked list class