Not doing it myself automatically it's probably best to review the logic if it's correct at the same time. I can tell you the needed changes if the logic is correct.
Removed from tree. bug #282909