add support for inheritance, update example