Adding a few methods to Matrix class