gevent worker code complete, needs testing