Never mind. I think what I came up with is correct, my command window just wasn't displaying it correctly. I wrote the results to an ini file and it looks fine.

Thanks!