add a non-recursive version