modifying script to adjust for upstream changes
removing dead bits