working mex files and matlab stuffs