generalize to take a callback function and a void * data argument. This might come in handy later... :-)