stack operations implemented with test script