switched to ctypes callbacks