correctly build an array of nodes, fixes #8