smarter diff not tested. smarter patch not implemented