basic matrix class