Implemented doRepeat block