A hybrid energy aware routing algorithm for wireless sensor networks