@FlyingChainSaw: I think the script would probably benefit from your rewrite.