Put mex function into separate file