public static int calculateColour(int myColour, int parentColour)
	{
		int z = (myColour ^ parentColour);
		int l =	(int)Math.log(Math.max(myColour, parentColour))+1;
		int i = 0;
		for (; i < l; i++)
		{
			if ((z & (1 << i)) > 0)
			{
				System.out.println("index " + i);
				break;
			}
		}
		int result = i*2;
		if ((myColour & (1 << i)) > 0)
			result++;
		return result;
	}