Implementation of SelectiveRepeat