Updated Matlab, working version, still some details missing