add tests
Merge branch 'master' into matlab