Implement a stack through resizing an array