changed how script is run for a slight performance improvement.