Change Function2 to a virtual function.