update this code to use newer cython conventions