various minor fixes
declare cython variables
use a single array
variable in cdef