Solution for nesting