return instead of break in for loop