Did you test this in the debugger?  This shows a row-major ordering, but I believe it should be column-major.