+1 for removing the if inside the loop