sort generated functions