how battery capacity works