Added back row-major matrix order code