Met with gregg again, he walked me trough how to optimize this script and how to use a stream_sampler to reduce the data collected