ugh, c++ not quite working