corrected function ...mark_repeats