match up with c++ version