transform written recursively