Solution for Nesting