public static int runPrimeDigitReplacement(){
		int i, j;
		int length;
		int prime, adder;
		int familySize, miss;
		
		// Populate the primes list
		getPrimes();
		
		// For each prime up to MAXVALUE 
		for(i= 11; i < MAXVALUE; i+=2){
			if(isPrime(i)){
				// Go through each possible pattern that this prime could be in a family for
				// (i.e. if i is 5 characters long go through:  10000, 10001, 10010 ... etc.)
				length = String.valueOf(i).length();
				for(j = 2; j < Math.pow(2, length); j++){
					// Convert the number to a binary string then back to an integer to get the adder.
					// (i.e. 5 turns into 101)
					adder = Integer.parseInt(Integer.toBinaryString(j));
					
					// Check that this adder is compatible with the given prime.
					if(!checkPosition(i, adder))
						continue;

					prime = i + adder;
					familySize = 1;
					miss = 0;

					// Using the adder check to see if a family of primes can be created that is as large as MINFAMILYSIZE
					while(miss <= 10 - MINFAMILYSIZE && familySize < MINFAMILYSIZE && String.valueOf(prime).length() == length ){
						if(isPrime(prime))
							familySize++;
						else
							miss++;
						prime+=adder;
					}
					// If a family was found return the smallest prime from that family (i.e. i) 
					if(familySize >= MINFAMILYSIZE){
						//System.out.println("Smallest prime: " + i + ", adder: " + adder);
						return i;
					}
				}	
			}
		}
		
		
		return 0;
	}