Tightening up the speed of this script.