added cython code for inner loops of LL funcs