Main .mex file