add inheritance code