converting to ctypes
working on hashed, optimized version