getData() updated. Loops are unnested.