Wireless Sensor Network (WSN) is a collection of large number of tiny sensor nodes that are deployed to monitor the physical environment such temperature, humidity, etc. The sensor readings must be routed to the base station and then to the end-user. These sensor nodes have limited capabilities, especially the energy reserve, the processing ability and the memory storage. So, the routing protocols design for this kind of networks is a crucial challenge. Since these routing protocols should be simple, energy-efficient, and robust to operate with a very large number of nodes. They should also be auto-configurable to node failures and changes of the network topology dynamically. This paper presents a new algorithm for gathering data in WSN based on chain forming using greedy algorithm. It focuses on equitably distributing the energy load over the whole network nodes. To avoid fast node dying, the leader role is better distributed over nodes based on their required energies to transmit to the sink. Thus, the entire network nodes would have the same lifetime and then as result, the network lifetime would be extended. We have conducted simulation-based evaluations to illustrate the performance of the proposed technique. The simulation results show that this algorithm allows network stability extension compared to the most known chaining algorithm.