create a stack using array