First, post code in code tags to avoid smileys.
Second, break out the Ping code into a simple function returning the range in your desired units - it'll make you code cleaner and easier to debug.
I must've posted the simple function a dozen times here.
Disclaimer: I don't own a Ping and have never used one.