improved docstrings
separated cdef functions