don't need this now, but maybe in future
pass item index to function calls

kt_for() to be replaced by more complex but more versatile APIs
more versatile APIs
test C++
revert to kt_for()

the new version is buggy and even if I could fix it, I would not feel
confident. Perhaps I will come back later when I am more competent.