Implementing the Stack interface with an array