Rewrited stack based on ArrayList

Rewrited stack based on ArrayList