implemented ping compution and heartbits