Revised iBM_Matlab