fixed Ping, in order to send it only half the timeout's time
some refactoring
new version