added layer nesting