some c++ reference code