diff --git a/src/queue.c b/src/queue.c
index a5f748845eb940b9d4d43a1d942d7273a3f9f4c0..191500f31178d7a05af5f274a82ec48296adbe91 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -98,7 +98,7 @@ float queue_task_overlap ( struct qsched *s , qsched_task_t a , qsched_task_t b
   
   /* Return the Jaccard similarity, i.e. the ratio of the intersection
      and the union. */
-  return ((float)res_isect) / res_union;
+  return ((float)res_isect) / (res_union - res_isect);
 }
 
 
@@ -159,6 +159,7 @@ int queue_get ( struct queue *q , struct qsched *s , int insist , int last ) {
         if (qsched_locktask(s, window[ind_max].tid)) {
           tid = window[ind_max].tid;
           ind = window[ind_max].ind;
+          // message("best task has overlap %f.", window[ind_max].score);
           break;
         } else {
           window[ind_max].ind = k;
@@ -177,6 +178,7 @@ int queue_get ( struct queue *q , struct qsched *s , int insist , int last ) {
         if (qsched_locktask(s, window[ind_max].tid)) {
           tid = window[ind_max].tid;
           ind = window[ind_max].ind;
+          // message("best task has overlap %f.", window[ind_max].score);
           break;
         } else {
           window_count -= 1;