chenkan's code for ping