Updated to make a common compile run function