replaced legacy linked list syntax to use generics instead