I have made changes to use dots for dimensions > 4 and also to handle if one of the dimensions is integer while other is a symbol
 [A11,A12 ...,A1m]
 [A21,A22 ...,A2m]
 [A31,A32 ...,A3m]