remove use of ctypes module