modified for polymorphism