generating output in one nested call