accepting a callback function