renamed calcThreshold, redone ping()