https://wikimass.com/c-sharp/matrix-transpose