xbox, the $v1 in the code followed by the last if condition refers to $2, so there is no difference if you change it to $2.
The overall code could be improved further, but I see Ryan wanted to take it up a notch with his own twist...so I'll leave it at that.