modify stack(array) implement to enable mutiple instance.