removed unsafe asInstanceOf in RoR calc and replaced it with type safe shapeless 'cast'