Implemented stack structure.