start of restraint generation