write up, testing mex file, java stuff