added functions to stack class