dscal[n_, a_, x_] := Table[x[[i]]*a,{i,n}]