dd three methods extending matrix class