failed with varargin feature of matlab.  hard-code output_flag to zero.