private BigInteger findFactor(){
		BigInteger sq = BigInteger.ONE.add(BigInteger.ONE);
		while(!limit.mod(sq).equals(BigInteger.ZERO) && (sq.compareTo(limit)<=0)){
				sq = sq.add(BigInteger.ONE);
			
		}
		System.out.println("Found 1st factor "+sq);
		if (sq.compareTo(limit)>0)
			return sq;
		BigInteger lq = limit.divide(sq);
		while (lq.compareTo(sq) >= 0){
			if (isPrime(lq)){
				return lq;
			}
			if (isPrime(sq)){
				largePrime = sq;
			}
			sq = sq.add(BigInteger.ONE);
			while(!limit.mod(sq).equals(BigInteger.ZERO) && (sq.compareTo(lq)<=0)){
				sq = sq.add(BigInteger.ONE);
			}
			lq = limit.divide(sq);
		}
		
		//if it reaches here, it means it's a prime number itself.
		if (largePrime.compareTo(BigInteger.ONE)>0 )
			return largePrime;
		else
			return limit; 
	}