Made some changes to functions printRing and addToRing.