Undid non-idiomatic code.

This is the general syntax for a self-invoking anonymous function.
Fixed broken part of script.

The loop is iterating through all members of the whitelist, which
is an array.