edit: I finally figured it out! I've been putting the variable definitions in the wrong place, it seems. I just needed to play around with it. Lack of experience. Thanks for your scripts, Mike and Nightdriver. And thanks Twey for pointing that out. Ultimately, that's what helped me see what I was doing wrong.
