                 measure (int (/ piano-roll-width MEASURE_WIDTH))
                 current-x-cell (int (/ (.getX e) note-width))
                 cell-delta (- current-x-cell @cell-x-start)
-                diff(if (> cell-delta 0) cell-delta 0)]
-                    (println "mouse dragged" x-cell y-cell start-x start-y cell-x-start cell-y-start cell-delta diff)
-
-                    (update-note x-cell y-cell active-notes-atom active-note diff)
-
-                    (.repaint (.getSource e))))
+                diff(+ 1 cell-delta)]
+
+                (update-note x-cell y-cell active-notes-atom active-note diff)
+                (.repaint (.getSource e))))
 
       :mouse-released
         (fn [e]  
 
-          (swap! creating-note (fn [b] false))
-          (.repaint (.getSource e))))
+          ; (swap! creating-note (fn [b] false))
+          ; (.repaint (.getSource e)))
+          ))
     panel))
 
 (defn create-piano-roll 

  (let [x (int (/ x note-width))
        y (int (/ y note-height))
        length (count @active-notes-atom)
        return-note (atom (contains-in? @active-notes-atom x y note-width))
        new-note-data {:velocity 1.0 :duration 1}]

      (if (not (nil? @return-note))
        (do
            (doseq [[k note] @return-note] 
              (doseq [[n note-data] note] 
               ; (swap! return-note (fn [_] {k {n note-data}} ))
                (swap! x-cell (fn [_] k))
                (swap! y-cell (fn [_] n)))))
        (do 

          ;; paint the active notes last
          (paint-active-notes notes active-notes g note-width note-height)))

(defn get-note [note-map x y note-width]
  (let [r (atom nil)]
    (doseq [[note-x notes] note-map] 
      (if (<= note-x x)
