implemented Stack.java