Implemented a general purpose stack