added more template inheritance code