Improving stack example somewhat