hacked colins code to support work queues