inheritance sample code