Closure function with travers