replace redundant function call w/ loop, explicit return instead of break (which just happened to return)