added some flesh to the worker code