merge old cpp codes