problems with matrix class