wip: fix matrix conversion