save some memory by using uint32 instead of int64 for matrix dimensions