Added more matrix functionality