fixing nested lists