Implementation of a stack data structure - using array