code from c++ class fvtc