Added support for multiple levels of parenting