rename more functions
fix for the case k=n
next d iterators