Distributed and Self-adaptive Cluster-head Selection Algorithm for Hierarchical Wireless Sensor Networks