linked lists modified for generics