minor script mod to speed this up