Program with a higher-order function