Working version of stack