nested for sample