Added automatic generation of Matrix NxN order