Made all matrix operations return pointers