 
 
 (def ^{:private true} default-port 8093)
+
 (def ^{:private true} max-data-length (* 13 60))
 (def ^{:private true} pwr-data (atom []))
 
-
 (def ^{:private true} prev-data (atom 0))
 
-; @pwr-data
+(defonce server (atom nil))
 
-;; store as list and return reversed vector ?
-; or a vector, as of now ?. What would be most efficient...
-
-; (last @pwr-data)
-; (vector? @pwr-data)
-
-; (vector? (rest (vector @pwr-data)))
-; (reset! pwr-data (rest (vec @pwr-data)))
 
 (defn- time-string [millisec]
   (str (t/from-time-zone

    (reset! server nil)))


; (start-server 8093)
; (stop-server)


(defn -main [& args]
  (let [port (Integer. (or (System/getenv "PORT") default-port))]
    (println "Using port:" port)

      ))



(defn start-server [port-no]
  (reset! server (run-server #'handler {:port port-no})))

(defn stop-server []
  (when-not (nil? @server)
