Intermediate checkin

Change-Id: Iaf775c4a88a8febcec8cb65b28301f57baeb41de
More simplification

Change-Id: I78ab4b98e7892a0290bcbf50a32bb347d280c5de
Improve loop index names

Change-Id: I5950ae99420fb62cbfdd707e5a09d341899fa66b