add c++ environment
tests pass in c++ implementation