patching up code