rm rep logic