private int[][] fillHeight(int[][] map)
	{
		
		int length = map.length / 2;
		
		//fill center tile
		map[(map.length - 1) / 2][(map[0].length - 1) /  2] = (map[0][0] + map[0][map[0].length - 1] + map[map.length - 1][0] + map[map.length - 1][map[0].length - 1]) / 4 + random(); 
		
		while (length > 0)
		{
			//do diamond step
			for(int i = 0; i < map.length / 2 / length; i++)
			{
				for(int j = 0; j < map.length / 2 / length; j++)
				{
					map = diamond(map, length + (j * 2 * length), length + (i * 2 * length), length);
				}
			}
			
			
			
			
			
			//do square step
			for(int i = 0; i < map.length / 2 / length; i++)
			{
				for(int j = 0; j < map.length / 2 / length; j++)
				{
					if(length > 1) map = square(map, length + (j * 2 * length), length + (i * 2 * length), length);
				}
			}
			
			if(length == 1)length = 0;
			length -= length / 2;
		}
		
		
		return map;
	}