correcting nested lists