Clean up of the ping function

So, by using functions the way they are suppose to be used I now have
the Ping function set up as a variable that I can call.