Updating constrainTo to accept array for handling arbitrary constraints