Why not use an "off-the-shelf" matrix library? Many moons ago I used one that I found on aminet, I did a quick search and they have a few libraries there now. I think the one I used was
http://aminet.net/pub/aminet/dev/c/matrix.lha it supports dynamic as you would expect.<br><br>Chris