Using tokenize in this case has no benefits whatsoever, and I hope you don't take offense to that. I've learned it the hard way myself. You insert $chr(10) additionally as a separator to correlate to numeric tokens, which is deemed more exhaustive than the original approach.
P.S. I know you'll probably take my socket incident as a weapon against me, but I wouldn't resume it if I were you.