fix and test, need to fix matrix, last time