modified Bar class (arguments of constructor and default value of dy)