This has been said in some replies in this tree, but sometime you can take the piece of code you don't understand as a black box, and bridge its behavior with new code, comparing both outputs during a few iterations, then remove old code.
This has been said in some replies in this tree, but sometime you can take the piece of code you don't understand as a black box, and bridge its behavior with new code, comparing both outputs during a few iterations, then remove old code.