def insert_before_each(middleware, *args, &block)
      self.stack = stack.reduce([]) do |carry, item|
        carry.push([middleware, args, block], item)
      end
    end
def insert_before_each(middleware, *args, &block)
      self.stack = stack.reduce([]) do |carry, item|
        carry.push([middleware, args, block], item)
      end
    end
Inserts a middleware before each middleware object