Basic matrix class