higher order function starting code