add first draft of mex file