Code almost finished for timing scripts