Basic functionality of Matrix class