This version is CUIS compatible.
minor correction

replace Stack with OrderedCollection
for CUIS 4.0 compatibility