adapted matching to preserve node ordering from input model