Calculating and Reducing the Runtime of a Script