public static boolean isPrime (int num) {
	boolean tmp = true;
        for ( int i=2; i<=Math.sqrt(num); i++ ) {
	    if ( num%i == 0 && num != 1 ) {
		tmp = false;
		break;
	    }
	}
	return tmp;
    }