removed constrainTempImpl - inlined by hand