diff --git a/Loop.xcodeproj/project.pbxproj b/Loop.xcodeproj/project.pbxproj
index 31c702607..dcd3922c5 100644
--- a/Loop.xcodeproj/project.pbxproj
+++ b/Loop.xcodeproj/project.pbxproj
@@ -1935,6 +1935,7 @@
 				C16DA84322E8E5FF008624C2 /* Install Plugins */,
 				C1D19800232CFA2A0096D646 /* Capture Build Details */,
 				4F70C1EC1DE8DCA8006380B7 /* Embed App Extensions */,
+				470A9D15233DAEED008DA68E /* Remove Sim Archs */,
 			);
 			buildRules = (
 			);
@@ -2138,6 +2139,7 @@
 					43776F8B1B8022E90074EA36 = {
 						CreatedOnToolsVersion = 7.0;
 						LastSwiftMigration = 1020;
+						ProvisioningStyle = Automatic;
 						SystemCapabilities = {
 							com.apple.ApplicationGroups.iOS = {
 								enabled = 1;
@@ -2159,6 +2161,7 @@
 					43A943711B926B7B0051FA24 = {
 						CreatedOnToolsVersion = 7.0;
 						LastSwiftMigration = 0800;
+						ProvisioningStyle = Automatic;
 						SystemCapabilities = {
 							com.apple.ApplicationGroups.iOS = {
 								enabled = 0;
@@ -2171,6 +2174,7 @@
 					43A9437D1B926B7B0051FA24 = {
 						CreatedOnToolsVersion = 7.0;
 						LastSwiftMigration = 1020;
+						ProvisioningStyle = Automatic;
 						SystemCapabilities = {
 							com.apple.ApplicationGroups.iOS = {
 								enabled = 0;
@@ -2513,6 +2517,24 @@
 			shellPath = /bin/sh;
 			shellScript = "\"${SRCROOT}/Scripts/copy-frameworks.sh\"\n";
 		};
+		470A9D15233DAEED008DA68E /* Remove Sim Archs */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 8;
+			files = (
+			);
+			inputFileListPaths = (
+			);
+			inputPaths = (
+			);
+			name = "Remove Sim Archs";
+			outputFileListPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+			shellPath = /bin/sh;
+			shellScript = "${SRCROOT}/Scripts/remove-sim-archs.sh\n";
+		};
 		A942E448225FD9D500DD4980 /* Copy Frameworks with Carthage */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -3440,7 +3462,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 11.4;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LOCALIZED_STRING_MACRO_NAMES = (
 					NSLocalizedString,
 					CFLocalizedString,
@@ -3506,7 +3528,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 11.4;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LOCALIZED_STRING_MACRO_NAMES = (
 					NSLocalizedString,
 					CFLocalizedString,
@@ -3530,8 +3552,9 @@
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
 				CODE_SIGN_ENTITLEMENTS = Loop/Loop.entitlements;
-				CODE_SIGN_IDENTITY = "iPhone Developer";
-				DEVELOPMENT_TEAM = "";
+				CODE_SIGN_IDENTITY = "Apple Development";
+				CODE_SIGN_STYLE = Automatic;
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				ENABLE_BITCODE = YES;
 				INFOPLIST_FILE = Loop/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -3540,6 +3563,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
+				PROVISIONING_PROFILE_SPECIFIER = "";
 			};
 			name = Debug;
 		};
@@ -3549,14 +3573,16 @@
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
 				CODE_SIGN_ENTITLEMENTS = Loop/Loop.entitlements;
-				CODE_SIGN_IDENTITY = "iPhone Developer";
-				DEVELOPMENT_TEAM = "";
+				CODE_SIGN_IDENTITY = "Apple Development";
+				CODE_SIGN_STYLE = Automatic;
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				ENABLE_BITCODE = YES;
 				INFOPLIST_FILE = Loop/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
+				PROVISIONING_PROFILE_SPECIFIER = "";
 			};
 			name = Release;
 		};
@@ -3566,15 +3592,17 @@
 				ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = "WatchApp Extension/WatchApp Extension.entitlements";
-				CODE_SIGN_IDENTITY = "iPhone Developer";
+				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
-				DEVELOPMENT_TEAM = "";
+				CODE_SIGN_STYLE = Automatic;
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
 				INFOPLIST_FILE = "WatchApp Extension/Info.plist";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER).LoopWatch.watchkitextension";
 				PRODUCT_NAME = "${TARGET_NAME}";
 				PROVISIONING_PROFILE = "";
+				PROVISIONING_PROFILE_SPECIFIER = "";
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "WatchApp Extension/Extensions/WatchApp Extension-Bridging-Header.h";
@@ -3589,15 +3617,17 @@
 				ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = "WatchApp Extension/WatchApp Extension.entitlements";
-				CODE_SIGN_IDENTITY = "iPhone Developer";
+				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
-				DEVELOPMENT_TEAM = "";
+				CODE_SIGN_STYLE = Automatic;
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
 				INFOPLIST_FILE = "WatchApp Extension/Info.plist";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER).LoopWatch.watchkitextension";
 				PRODUCT_NAME = "${TARGET_NAME}";
 				PROVISIONING_PROFILE = "";
+				PROVISIONING_PROFILE_SPECIFIER = "";
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "WatchApp Extension/Extensions/WatchApp Extension-Bridging-Header.h";
@@ -3610,9 +3640,10 @@
 			buildSettings = {
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
-				CODE_SIGN_IDENTITY = "iPhone Developer";
+				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
-				DEVELOPMENT_TEAM = "";
+				CODE_SIGN_STYLE = Automatic;
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
 				IBSC_MODULE = WatchApp_Extension;
 				INFOPLIST_FILE = WatchApp/Info.plist;
@@ -3620,6 +3651,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER).LoopWatch";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
+				PROVISIONING_PROFILE_SPECIFIER = "";
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
 				TARGETED_DEVICE_FAMILY = 4;
@@ -3631,9 +3663,10 @@
 			buildSettings = {
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
-				CODE_SIGN_IDENTITY = "iPhone Developer";
+				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
-				DEVELOPMENT_TEAM = "";
+				CODE_SIGN_STYLE = Automatic;
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
 				IBSC_MODULE = WatchApp_Extension;
 				INFOPLIST_FILE = WatchApp/Info.plist;
@@ -3641,6 +3674,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "$(MAIN_APP_BUNDLE_IDENTIFIER).LoopWatch";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
+				PROVISIONING_PROFILE_SPECIFIER = "";
 				SDKROOT = watchos;
 				SKIP_INSTALL = YES;
 				TARGETED_DEVICE_FAMILY = 4;
@@ -3913,7 +3947,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = "";
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = "Loop Status Extension/Info.plist";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
@@ -3935,7 +3969,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = "";
+				DEVELOPMENT_TEAM = 6Q7ZC8Q56M;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = "Loop Status Extension/Info.plist";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
diff --git a/Loop/Managers/DeviceDataManager.swift b/Loop/Managers/DeviceDataManager.swift
index ae05b2a81..6dc840c37 100644
--- a/Loop/Managers/DeviceDataManager.swift
+++ b/Loop/Managers/DeviceDataManager.swift
@@ -12,6 +12,8 @@ import LoopKitUI
 import LoopCore
 import LoopTestingKit
 import UserNotifications
+import AudioToolbox
+import AVFoundation
 
 final class DeviceDataManager {
 
@@ -25,6 +27,9 @@ final class DeviceDataManager {
     /// Remember the launch date of the app for diagnostic reporting
     private let launchDate = Date()
 
+    /// set initial lastAlarmDate to launchDate minus 24 hours
+    var lastAlarmDate = Date() - .hours(24)
+    
     /// Manages authentication for remote services
     let remoteDataManager = RemoteDataManager()
 
@@ -373,11 +378,248 @@ extension DeviceDataManager: PumpManagerDelegate {
             if let manager = self.cgmManager {
                 self.queue.async {
                     self.processCGMResult(manager, result: result)
+                    //check alarm and vibrate if below urgent low
+                    self.checkAlarms()
+                    //
                 }
             }
         }
     }
 
+    /////////////////////
+    func vibrate() {
+       DispatchQueue.main.async {
+           var i = 0
+           while i < 25 {
+               AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))
+               sleep(1)
+               i+=1
+           }
+       }
+       }
+      
+       func checkAlarms() {
+    
+           let bgLowThreshold : Double = 60.0 //in mg/dL
+           let snoozeMinutes : Double = 30.0
+           let oldBGLimit : Double = 45.0 //in minutes
+           let lastestGlucose = loopManager.glucoseStore.latestGlucose
+           let deltaAlarmTime = Date().timeIntervalSince(lastAlarmDate)
+           //TODO add logic for what happens if no lastBG exists
+           if deltaAlarmTime < snoozeMinutes {
+               print("****Vibration Snooze****")
+               return
+           }
+           
+           if let lastBGDate = lastestGlucose?.startDate {
+               let deltaBGDate = Date().timeIntervalSince(lastBGDate)
+               if deltaBGDate > .minutes(oldBGLimit) {
+                   print("**************")
+                   print("VIBRATION ALARM OLD BG DATA")
+                   lastAlarmDate = Date()
+                   vibrate()
+                   return
+               }
+           }
+           
+           if let lastBGValue = lastestGlucose?.quantity.doubleValue(for: HKUnit.milligramsPerDeciliter) {
+               if lastBGValue < bgLowThreshold {
+                   print("**************")
+                   print("VIBRATION ALARM LOW BG")
+                   lastAlarmDate = Date()
+                   vibrate()
+                   return
+               }
+           }
+       print("*****Finished Alarms*****")
+       }
+      
+    
+      /////////////////////
+    /////////////////////
+    
+    
+    
+    
+    //////////////////////////////////////////
+    // MARK: - Set Temp Targets From NS
+    // by LoopKit Authors Ken Stack, Katie DiSimone
+    struct NStempTarget : Codable {
+        let created_at : String
+        let duration : Int
+        let targetBottom : Double?
+        let targetTop : Double?
+        let notes : String?
+    }
+    
+    func doubleIsEqual(_ a: Double, _ b: Double, _ precision: Double) -> Bool {
+        return fabs(a - b) < precision
+    }
+    
+    func setNStemp () {
+        // data from URL logic from modified http://mrgott.com/swift-programing/33-rest-api-in-swift-4-using-urlsession-and-jsondecode
+        //look at users nightscout treatments collection and implement temporary BG targets using an override called remoteTempTarget that was added to Loopkit
+        //user set overrides always have precedence
+        
+        //check that NSRemote override has been setup
+        var presets = self.loopManager.settings.overridePresets
+        var idArray = [String]()
+        for preset in presets {
+            idArray.append(preset.name)
+        }
+        
+        guard let index = idArray.index(of:"NSRemote") as? Int else {return}
+        if let override = self.loopManager.settings.scheduleOverride, override.isActive() {
+            //find which preset is active and see if its NSRemote
+            if override.context == .preMeal || override.context == .custom {return}
+            let raw = override.context.rawValue
+            let rawpreset = raw["preset"] as! [String:Any]
+            let name = rawpreset["name"] as! String
+            //if a diffrent local preset is running don't change
+            if name != "NSRemote" {return}
+        }
+        
+        let nightscoutService = remoteDataManager.nightscoutService
+        guard let nssite = nightscoutService.siteURL?.absoluteString  else {return}
+        let formatter = ISO8601DateFormatter()
+        formatter.formatOptions = [.withFullDate,
+                                   .withTime,
+                                   .withDashSeparatorInDate,
+                                   .withColonSeparatorInTime]
+        //how far back to look for valid treatments in hours
+        let treatmentWindow : TimeInterval = TimeInterval(.hours(24))
+        let now : Date = Date()
+        let lasteventDate : Date = now - treatmentWindow
+        //only consider treatments from now back to treatmentWindow
+        let urlString = nssite + "/api/v1/treatments.json?find[eventType]=Temporary%20Target&find[created_at][$gte]="+formatter.string(from: lasteventDate)+"&find[created_at][$lte]=" + formatter.string(from: now)
+        guard let url = URL(string: urlString) else {
+            return
+        }
+        let session = URLSession.shared
+        var request = URLRequest(url: url)
+        request.httpMethod = "GET"
+        request.cachePolicy = NSURLRequest.CachePolicy.reloadIgnoringCacheData
+        session.dataTask(with: request as URLRequest) { (data, response, error) in
+            if error != nil {
+                
+                return
+            }
+            guard let data = data else { return }
+            
+            do {
+                let temptargets = try JSONDecoder().decode([NStempTarget].self, from: data)
+                self.log.default("temptarget count: \(temptargets.count)")
+                //check to see if we found some recent temp targets
+                if temptargets.count == 0 {return}
+                //find the index of the most recent temptargets - sort by date
+                var cdates = [Date]()
+                for item in temptargets {
+                    cdates.append(formatter.date(from: (item.created_at as String))!)
+                }
+                let last = temptargets[cdates.index(of:cdates.max()!) as! Int]
+                //if duration is 0 we dont care about minmax levels, if not we need them to exist as Double
+                self.log.default("last temptarget: \(last)")
+                //cancel any prior remoteTemp if last duration = 0 and remote temp is active else return anyway
+                if last.duration < 1 {
+                    if let override = self.loopManager.settings.scheduleOverride, override.isActive() {
+                        self.loopManager.settings.clearOverride()
+                        //        NotificationManager.sendRemoteTempCancelNotification()
+                    }
+                    return
+                }
+                
+                //NS doesnt check to see if a duration is created but no targets exist - so we have too
+                if last.duration != 0 {
+                    guard last.targetBottom != nil else {return}
+                    guard last.targetTop != nil else {return}
+                }
+                
+                if last.targetTop!.isLess(than: last.targetBottom!) {return}
+                
+                // set the remote temp if it's valid and not already set.  Handle the nil issue as well
+                let endlastTemp = cdates.max()! + TimeInterval(.minutes(Double(last.duration)))
+                if Date() < endlastTemp  {
+                    let NStargetUnit = HKUnit.milligramsPerDeciliter
+                    let userUnit = self.loopManager.settings.glucoseTargetRangeSchedule?.unit
+                    //convert NS temp targets to an HKQuanity with units and set limits (low of 70 mg/dL, high of 300 mg/dL)
+                    //ns temps are always given in mg/dL
+                    
+                    let lowerTarget : HKQuantity = HKQuantity(unit : NStargetUnit, doubleValue:max(50.0,last.targetBottom as! Double))
+                    let upperTarget : HKQuantity = HKQuantity(unit : NStargetUnit, doubleValue:min(400.0,last.targetTop as! Double))
+                    //set the temp if override isn't enabled or is nil ie never enabled
+                    //if unwraps as nil set it to 1.0 - user only setting glucose range
+                    var multiplier : Double = 100.0
+                    if last.notes != nil {multiplier = Double(last.notes as! String) ?? 100.0}
+                    multiplier = multiplier / 100.0
+                    //safety settings
+                    if multiplier < 0.0 || multiplier > 3.0 {
+                        multiplier = 1.0
+                    }
+                    multiplier = max(0.1, multiplier)
+                    let dateFormatter = DateFormatter()
+                    dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSZ"
+                    let created_at = dateFormatter.date(from: last.created_at)
+                    let intervalSinceCreated = now.timeIntervalSince(created_at!)
+                    let duration_seconds = Double(last.duration)*60.0 - intervalSinceCreated
+                    if self.loopManager.settings.scheduleOverride == nil || self.loopManager.settings.scheduleOverride?.isActive() != true {
+                        
+                        presets[index].duration = .finite(.seconds(duration_seconds))
+                        let overrideRange = DoubleRange(minValue: lowerTarget.doubleValue(for: userUnit!), maxValue: upperTarget.doubleValue(for: userUnit!))
+                        let settings = TemporaryScheduleOverrideSettings(unit: .milligramsPerDeciliter, targetRange: overrideRange, insulinNeedsScaleFactor: multiplier)
+                        presets[index].settings = settings
+                        self.loopManager.settings.overridePresets = presets
+                        let enactOverride = presets[index].createOverride(enactTrigger: .local, beginningAt: cdates.max()!)
+                        self.loopManager.settings.scheduleOverride = enactOverride
+                        return
+                    }
+                    
+                    print("in override already set check")
+                    // check to see if the last remote temp treatment is different from the current and if it is, then set it
+                    let currentRange = presets[index].settings.targetRange
+                    let duration = presets[index].duration.timeInterval ?? 1.0 as TimeInterval
+                    guard let override = self.loopManager.settings.scheduleOverride else {
+                        return
+                    }
+                    let startDate = override.startDate
+                    let activeDate = startDate + duration
+                    
+                    //debugging
+                    print(activeDate)
+                    print(endlastTemp)
+                    print(abs(activeDate.timeIntervalSince(endlastTemp)))
+                    //
+                    
+                    if self.doubleIsEqual(presets[index].settings.insulinNeedsScaleFactor!, multiplier, 0.01) == false ||
+                        self.doubleIsEqual((currentRange?.upperBound.doubleValue(for: userUnit!) ?? 0), upperTarget.doubleValue(for: userUnit!), 1.0) == false ||
+                        self.doubleIsEqual((currentRange?.lowerBound.doubleValue(for: userUnit!) ?? 0), lowerTarget.doubleValue(for: userUnit!), 1.0) == false ||
+                        abs(activeDate.timeIntervalSince(endlastTemp)) > TimeInterval(.minutes(10)) {
+                        
+                        print("override is different then current active override")
+                        let overrideRange = DoubleRange(minValue: lowerTarget.doubleValue(for: userUnit!), maxValue: upperTarget.doubleValue(for: userUnit!))
+                        let settings = TemporaryScheduleOverrideSettings(unit: .milligramsPerDeciliter, targetRange: overrideRange, insulinNeedsScaleFactor: multiplier)
+                        presets[index].settings = settings
+                        presets[index].duration = .finite(.seconds(duration_seconds))
+                        self.loopManager.settings.overridePresets = presets
+                        let enactOverride = presets[index].createOverride(enactTrigger: .local, beginningAt: cdates.max()!)
+                        self.loopManager.settings.scheduleOverride = enactOverride
+                        return
+                    }
+                    
+                }
+                else {
+                    //do nothing
+                }
+            } catch let jsonError {
+                print("error in nstemp")
+                print(jsonError)
+                
+                return
+            }
+        }.resume()
+    }
+    
+    
+    
     func pumpManagerMustProvideBLEHeartbeat(_ pumpManager: PumpManager) -> Bool {
         dispatchPrecondition(condition: .onQueue(queue))
         return pumpManagerMustProvideBLEHeartbeat
@@ -501,6 +743,15 @@ extension DeviceDataManager: PumpManagerDelegate {
     func pumpManagerRecommendsLoop(_ pumpManager: PumpManager) {
         dispatchPrecondition(condition: .onQueue(queue))
         log.default("PumpManager:\(type(of: pumpManager)) recommends loop")
+        
+        
+        //////
+          // update BG correction range overrides via NS
+          // this call may be more appropriate somewhere
+          let allowremoteTempTargets : Bool = true
+          if allowremoteTempTargets == true {self.setNStemp()}
+        
+        
         loopManager.loop()
     }
 
@@ -592,8 +843,9 @@ extension DeviceDataManager: LoopDataManagerDelegate {
         guard let pumpManager = pumpManager else {
             return units
         }
-        
-        let rounded = ([0.0] + pumpManager.supportedBolusVolumes).enumerated().min( by: { abs($0.1 - units) < abs($1.1 - units) } )!.1
+        let supportedBolusVolumes = ([0.0] + pumpManager.supportedBolusVolumes)
+        let rounded = supportedBolusVolumes.enumerated().min( by: { abs($0.1 - units) < abs($1.1 - units) } )!.1
+        // let rounded = ([0.0] + pumpManager.supportedBolusVolumes).enumerated().min( by: { abs($0.1 - units) < abs($1.1 - units) } )!.1
         self.log.default("Rounded \(units) to \(rounded)")
         
         return rounded
diff --git a/Loop/Managers/DoseMath.swift b/Loop/Managers/DoseMath.swift
index ff6f429f9..e9a7c1275 100644
--- a/Loop/Managers/DoseMath.swift
+++ b/Loop/Managers/DoseMath.swift
@@ -518,7 +518,9 @@ extension Collection where Element: GlucoseValue {
         guard let correction = self.insulinCorrection(
             to: correctionRange,
             at: date,
-            suspendThreshold: suspendThreshold ?? correctionRange.quantityRange(at: date).lowerBound,
+            //suspendThreshold: suspendThreshold ?? correctionRange.quantityRange(at: date).lowerBound,
+            //fix suspenpend threshold so that shorter duration carbs do not get underbolused
+            suspendThreshold: HKQuantity(unit: HKUnit.milligramsPerDeciliter, doubleValue: 55.0),
             sensitivity: sensitivity.quantity(at: date),
             model: model
         ) else {
diff --git a/Scripts/remove-sim-archs.sh b/Scripts/remove-sim-archs.sh
new file mode 100755
index 000000000..c104a256e
--- /dev/null
+++ b/Scripts/remove-sim-archs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh -e
+
+APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
+
+# This script loops through the frameworks embedded in the application and
+# removes x86_64 and i386 architectures.
+find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
+do
+    FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
+    FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
+
+    if [ ! -f "${FRAMEWORK_EXECUTABLE_PATH}" ]; then
+        continue
+    fi
+
+    echo "Thinning framework $FRAMEWORK_EXECUTABLE_NAME"
+    
+    if xcrun lipo -info "${FRAMEWORK_EXECUTABLE_PATH}" | grep --silent "Non-fat"; then
+        echo "   Framework non-fat, skipping"
+        continue
+    fi
+
+    ARCHS=$(lipo -archs "$FRAMEWORK_EXECUTABLE_PATH")
+
+    for ARCH in $ARCHS
+    do
+       if [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "i386" ]; then
+        echo "   Removing $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
+        xcrun lipo -remove "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH"
+       fi
+    done
+done
+
