start rewriting all in c++
rewrite sindex on c++
fixed memory leak