made matrix class