Stack implementation using arrays