work in progress... ping function finished