Tightened up script.