outsourcing \o/
fixed error in merging of results while generating constraints