changed to take advantage of polymorphism