wrote stack class (chapter 16)