changed creation of 3d array