polymorphism works on references as well as pointers