Understanding functions as first-class citizens