diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js
index <HASH>..<HASH> 100644
--- a/lib/determine-basal/determine-basal.js
+++ b/lib/determine-basal/determine-basal.js
@@ -374,10 +374,20 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
             }
         }
     }
+  
+    var minutes_running;
+    if (typeof currenttemp.duration == 'undefined' || currenttemp.duration == 0) {
+        minutes_running = 30;
+    } else if (typeof currenttemp.minutesrunning !== 'undefined'){
+        // If the time the current temp is running is not defined, use default request duration of 30 minutes.
+        minutes_running = currenttemp.minutesrunning;
+    } else {
+        minutes_running = 30 - currenttemp.duration;
+    }
 
     // if there is a low-temp running, and eventualBG would be below min_bg without it, let it run
     if (round_basal(currenttemp.rate, profile) < round_basal(basal, profile) ) {
-        var lowtempimpact = (currenttemp.rate - basal) * (currenttemp.duration/60) * sens;
+        var lowtempimpact = (currenttemp.rate - basal) * ((30-minutes_running)/60) * sens;
         var adjEventualBG = eventualBG + lowtempimpact;
         if ( adjEventualBG < min_bg ) {
             rT.reason += "letting low temp of " + currenttemp.rate + " run.";
lowtempimpact based on <I> minutes (#<I>)

* lowtempimpact based on <I> minutes



@Scott



* <I> as default for minutes_running