updated shortest repetition