fixed matrix-major-ordering  and added comments