updated script that ... you know ... actually works.