Implemented a stack data structure