Fixed example and added Erase testing
Add Erase functionality and Flatten only for a parent
Move Erase to cpp file