added array-based stack implementation