Rewrite 'expandRule`
This now operates correctly. Just need to test the validation with the tree
This now operates correctly. Just need to test the validation with the tree