Finished conversion for run.js