implemented linked list template