pass object to constrain function