matrix class done.