Now the loop is entered at least once, also for val = 0