adds proper inheritance code to javascript example using class package