add comments to explain Stack usage.