Adding nesting levels and fine tunning