Changed dealer so that it can be used directly for any queue.