Could you try to make this loop clearer? Maybe make it 2 imbricated loops instead?