working in multi-level case