reworked constrain