main method to interact with array backed stack