updated c++ code using new id and uid system