A straightforward looping solution