working on mex file