The stack implementation