Implemented stack using arrays