first pass node hierarchy