slightly nicer: move guts of innerLoop2 back into do notation