fix matrix crazyness