working version of stack sh