c++ code somehow seems to work, slight improvement to run-script