Added some robustness, timing, and scripting