Getting more life out of lithium-ion batteries