FYI, probably good (if you haven't already) to declare arg(1) as a constant, since you're relying on that here (even, though, I realize this is created internally).