vp estimation added in c++ codes