# [Mathematica 6.0+] Preserving order of variables

 Sci Advisor HW Helper P: 4,300 [Mathematica 6.0+] Preserving order of variables If you want distributivity, you probably want to define something like ExpandNCM[x_] := x //. { NonCommutativeMultiply[a__, b_ + c_, d__] :> a ** b ** d + a ** c ** d } So that, for example, a ** (b + c) ** d // ExpandNCM gives a ** b ** d + a ** c ** d . By the way, you can also try ClearAttributes[Times, Orderless] but I don't think it's the best solution because the Orderless attribute gets re-set seemingly at random.