Fully working smart nesting