another try to fix matrix