moving to cffi for easier python implementation portability