represent a list as a chain of nodes