add methods to Matrix