Implemented MemoryStack functionality but they're untested for now.