added testing for deep nesting and drove out bug for deep nesting