improved integrate.cps somewhat