Thank you everyone, Zaxo's and sgifford's methods work perfectly. (I'm sure pg's would have too, but the other two are just simpler, i dont have to load a module.)
And yes, i will certainly be verifying the parameters to make sure they're not doing anything like that!