Dynamically exchange parts of a patch

Thx @digitalwannabe for this reference to a similar request