public void generateMapInside() {
	/**
	 * This method will basically generate the map for the game.
	 */

	int[] xLakes = new int[lakes];
	int[] yLakes = new int[lakes];
	int tries = 0;
	for (int i = 0; i < lakes; i++) {
	    int xLake = random.nextInt(mapWidth - avgLakeSize) + avgLakeSize / 2;
	    int yLake = random.nextInt(mapHeight - avgLakeSize) + avgLakeSize / 2;
	    for (;;) {
		boolean near = false;
		for (int j = 0; j < i; j++) {
		    int a = xLake - xLakes[j];
		    int b = yLake - yLakes[j];
		    near |= a * a + b * b < avgLakeSize * avgLakeSize;
		}
		if (!near || tries++ > 4)
		    break;
		xLake = random.nextInt(mapWidth - avgLakeSize) + avgLakeSize / 2;
		yLake = random.nextInt(mapHeight - avgLakeSize) + avgLakeSize / 2;
	    }
	    xLakes[i] = xLake;
	    yLakes[i] = yLake;
	    int xDir, yDir;

	    for (int j = 0; j < avgLakeSize / 4; j++) {
		do {
		    xDir = random.nextInt(2) - 1;
		    yDir = random.nextInt(2) - 1;
		} while (xDir == 0 && yDir == 0);
		try {
		    for (int k = 0; k < random.nextGaussian() * avgLakeSize; k++) {
			map[xLake][yLake] = Tile.water;
			map[xLake][yLake + 1] = Tile.water;
			map[xLake][yLake - 1] = Tile.water;
			map[xLake + 1][yLake] = Tile.water;
			map[xLake - 1][yLake] = Tile.water;
			if (random.nextBoolean())
			    map[xLake + 1][yLake + 1] = Tile.water;
			if (random.nextBoolean())
			    map[xLake + 1][yLake - 1] = Tile.water;
			if (random.nextBoolean())
			    map[xLake - 1][yLake + 1] = Tile.water;
			if (random.nextBoolean())
			    map[xLake - 1][yLake - 1] = Tile.water;
			xLake += xDir;
			yLake += yDir;
		    }
		} catch (ArrayIndexOutOfBoundsException e) {
		}
	    }
	}

	int[] xSands = new int[sandbanks];
	int[] ySands = new int[sandbanks];
	tries = 0;
	for (int i = 0; i < sandbanks; i++) {
	    int xSand = random.nextInt(mapWidth - avgSandbankSize) + avgSandbankSize / 2;
	    int ySand = random.nextInt(mapHeight - avgSandbankSize) + avgSandbankSize / 2;
	    for (;;) {
		boolean near = false;
		for (int j = 0; j < i; j++) {
		    int a = xSand - xSands[j];
		    int b = ySand - ySands[j];
		    near |= a * a + b * b < avgSandbankSize * avgSandbankSize;
		}
		for (int j = 0; j < i; j++) {
		    int a = xSand - xLakes[j];
		    int b = ySand - yLakes[j];
		    near |= a * a + b * b < avgSandbankSize * avgSandbankSize;
		}
		if (!near || tries++ > 4)
		    break;
		xSand = random.nextInt(mapWidth - avgSandbankSize) + avgSandbankSize / 2;
		ySand = random.nextInt(mapHeight - avgSandbankSize) + avgSandbankSize / 2;
	    }
	    xSands[i] = xSand;
	    ySands[i] = ySand;
	    int xDir, yDir;

	    for (int j = 0; j < avgSandbankSize / 4; j++) {
		do {
		    xDir = random.nextInt(2) - 1;
		    yDir = random.nextInt(2) - 1;
		} while (xDir == 0 && yDir == 0);
		try {
		    for (int k = 0; k < random.nextGaussian() * avgSandbankSize; k++) {
			map[xSand][ySand] = Tile.sand;
			map[xSand][ySand + 1] = Tile.sand;
			map[xSand][ySand - 1] = Tile.sand;
			map[xSand + 1][ySand] = Tile.sand;
			map[xSand - 1][ySand] = Tile.sand;
			if (random.nextBoolean())
			    map[xSand + 1][ySand + 1] = Tile.sand;
			if (random.nextBoolean())
			    map[xSand + 1][ySand - 1] = Tile.sand;
			if (random.nextBoolean())
			    map[xSand - 1][ySand + 1] = Tile.sand;
			if (random.nextBoolean())
			    map[xSand - 1][ySand - 1] = Tile.sand;
			xSand += xDir;
			ySand += yDir;
		    }
		} catch (ArrayIndexOutOfBoundsException e) {
		}
	    }
	}
    }