do an inorder traversal instead of grouping by macro type