private static int toDecimal(String str)
	{
		int dec;
		dec = 0;
		for(int i = 0; i < str.length(); i++)
		{
			int val = 0;
			if(Character.isDigit(str.charAt(i))) //0-9
			{
				val += Integer.parseInt(str.substring(i,i+1));
			}
			else //a-f
			{
				val = str.charAt(i) - 'a' + 10;
			}
			//Now multiply by its place.
			dec += val * Math.pow(16, str.length() - 1 -  i);
		}
		return dec;
	}