Maximizing Lifetime for a Sensor Network