minor changes for testing in Matlab