added recursion to the transformer