Defining a callback function with a variable number of arguments