Implementing array based stack