another way to remove the if statemtn - issue is that the function yielded to needs to return true