It seems like it should be straight forward. But I am lost. All the elements get the ‘leaf’ class unless they are a parent of a child element. The first parent or the first child get ‘first’ added to the class. The last parent or child get ‘last’ added to the class. All parents get only ‘expanded’ as their class. If the item is the active page then the a tag gets the class “active”.