The document discusses a new method for enhancing the lifetime of wireless sensor networks (WSNs) using an improved LEACH algorithm that incorporates clustering based on node energy and distance from the base station. It divides the network into virtual layers and optimizes cluster head selection to maximize energy efficiency and network longevity. The proposed algorithm outperformed traditional LEACH and E-LEACH protocols in terms of energy consumption and network lifetime in both homogeneous and heterogeneous environments.