made some functions virtual.