add support for patching. resolves #2