added polymorphism and runtime exception