implemented a stack using arrays