improved matrix rendering