bug fixing of the Matlab files