Added extra code to keep track of which constraint generated which other constraint