Tried to further integrate the matlab scripts. Testing is needed! Things might work on 64bit Linux, but MacOS still remains untested...