generate a patch