Retrieved Danilo's modifications for Ring class