added a stack implementation which is internally based on an array