Failure mechanicms in overdischarged and overcharged lithium-ion batteries