private void changeDirection(Unit u)
    { // 0 = UP, 1 = DOWN, 2 = LEFT, 3 = RIGHT
	int[] chances = new int[4];
	
	if (u.getDirection().equals("U"))
	{
	    chances[0] = generator.nextInt(5);
	    chances[1] = generator.nextInt(10);
	    chances[2] = generator.nextInt(20);
	    chances[3] = generator.nextInt(20);
	}
	if (u.getDirection().equals("D"))
	{
	    chances[0] = generator.nextInt(10);
	    chances[1] = generator.nextInt(5);
	    chances[2] = generator.nextInt(20);
	    chances[3] = generator.nextInt(20);
	}
	if (u.getDirection().equals("L"))
	{
	    chances[0] = generator.nextInt(20);
	    chances[1] = generator.nextInt(20);
	    chances[2] = generator.nextInt(5);
	    chances[3] = generator.nextInt(10);
	}
	if (u.getDirection().equals("R"))
	{
	    chances[0] = generator.nextInt(20);
	    chances[1] = generator.nextInt(20);
	    chances[2] = generator.nextInt(10);
	    chances[3] = generator.nextInt(5);
	}
	int index = 0;
	int max = 0;
	for (int a = 0; a < chances.length; a++)
	{
	    
	    if (chances[a] > max)
	    {
		max = chances[a];
		index = a;
	    }
	}
	switch (index)
	{
	    case 0:
	    {
		u.setDirection("U");
	    }
		break;
	    case 1:
	    {
		u.setDirection("D");
	    }
		break;
	    case 2:
	    {
		u.setDirection("R");
	    }
		break;
	    case 3:
	    {
		u.setDirection("L");
	    }
		break;
	    default:
	    {
		u.setDirection("U");
	    }
		break;
	}
	
    }