update.constraint function

function for updating constrints, not well tested, may be broken