So two for loops become two while loops - what's the problem?