modified sample.m file