modified control.m