createFromMatrix

fix some bugs