building up linked list template