fix counting of avg path length
fix counting of avg path length