a simpler stack implementation