Here's some hopefully simple changes (ie not c++ code)