write control code