stable version with inheritance and cyclic dependency forword declaration