There's room in this sample for further enhancement,
if any one is feeling ambitious.
With the addition of a second stack for the selection indices,
it should be possible to gather together the list of choices that led
to the current branch of the tree.
Further thought would be needed to determine which of the
choices were based on choice by tag versus choice by browse.