popStack = do is <- getState >>= return . iStack
              case is of
                   []    -> return Nothing
                   (x:_) -> modifyStack tail >> return (Just x)
popStack = do is <- getState >>= return . iStack
              case is of
                   []    -> return Nothing
                   (x:_) -> modifyStack tail >> return (Just x)
popStack = do is <- getState >>= return . iStack
              case is of
                   []    -> return Nothing
                   (x:_) -> modifyStack tail >> return (Just x)