passcod's "golfed" version of my script.