started adding gevent-based code