Completed simple repeat logic.