creating a better pipeline script