public void changeNumLayers(int newLayerNum){
	//	if(newWidth > 0 && newHeight > 0){
			int tileSize = parent.tilePanel.getTileSize();
			int[][][] temp = new int[tileID.length][tileID[0].length][tileID[0][0].length];
			//do this for every layer
			for(int k = 0; k < tileID.length; k++){	
				
				//copy old array
				temp[k] = Arrays.copyOf(tileID[k], tileID[k].length);
		
				
			}
			
			//parent.error("CNL->temp[0].length (1): " + temp[0].length);
			
			//create new array
			tileID = new int[newLayerNum][temp[0].length][temp[0][0].length];
			//parent.error("height: " + tileID[0][0].length);
			
			//parent.error("CNL->tileID[0].length (1): " + tileID[0].length);
			
			//create var aWidth, and give it the size of the old array if it's longer then the old array
			int aLayerNum = newLayerNum;
			if(temp.length < newLayerNum) aLayerNum =  temp.length;
			
			//copy old array into new array
		
			for(int k = 0; k < aLayerNum; k++){
				for(int i = 0; i < tileID[0].length; i++){
					tileID[k][i] = Arrays.copyOf(temp[k][i], tileID[0][0].length);
				}
			}
	
			
			if(getCurrentLayer() > getMapLayers()) setCurrentLayer(getMapLayers());
			//parent.error("CNL->tileID[0].length (2): " + tileID[0].length);
			//repaint the screen
			this.repaint();
			//setPreferredSize(new Dimension(tileID[0].length * tileSize, tileID[0][0].length * tileSize));
			this.revalidate();
			parent.jsp.revalidate();
			
			//backUpTiles();
			System.out.println(tileID.length);
		
	//}
		//else parent.error("Map width and height must be positive.");
	}