add virtual functions example