public static boolean hasNonRepeatingSpacers(CRISPR candidateCRISPR, double maxSimilarity)
   {
      //assumes at least two elements
      String firstRepeat = candidateCRISPR.repeatStringAt(0);
      String firstSpacer = candidateCRISPR.spacerStringAt(0);

      if (candidateCRISPR.numRepeats() >= 3)
      {
         int i = 0;
         while ( (i < candidateCRISPR.numSpacers() - 1) )
         {
            if (i == 4)  //only check first 5 spacers
               return true;

            String currSpacer = candidateCRISPR.spacerStringAt(i);
            String nextSpacer = candidateCRISPR.spacerStringAt(i + 1);
            String currRepeat = candidateCRISPR.repeatStringAt(i);

            //spacers should be different
            if ( DNASequence.getSimilarity(currSpacer, nextSpacer) > maxSimilarity )
               return false;

            //repeats should also be different from spacers, otherwise may be tandem repeat
            if ( DNASequence.getSimilarity(currRepeat, currSpacer) > maxSimilarity )
               return false;

            i++;
         }

         //checks last repeat/spacer
         if ( DNASequence.getSimilarity(candidateCRISPR.repeatStringAt(i), candidateCRISPR.spacerStringAt(i)) > maxSimilarity )
            return false;

         return true;
      }

      //we check that the spacer is different from the repeat
      else if (candidateCRISPR.numRepeats() == 2)
      {
         if (firstSpacer.equals(""))
            return false;
         else
            return ( DNASequence.getSimilarity(firstSpacer, firstRepeat) < maxSimilarity );
      }

      else
      {
         return false;
      }

   }