fixed rg calculation bug