Code to make the distinction between rg, cr and cc