The only thing that is new in Listing 5 is
(Once again, note the exclamation mark, which is a not operator in the conditional clause of that if statement.)