Fixed up c++ and actually output the correct things