modified func ...mark_repeats