       (aset visited node-id false)
       @max)))
 
-(def nodes (to-array (read-places)))
-(def visited (make-array Boolean/TYPE (count nodes)))
-(print (get-longest-path nodes 0 visited))
+(defn -main []
+  (let [nodes (to-array (read-places))
+        visited (make-array Boolean/TYPE (count nodes))]
+    (print (get-longest-path nodes 0 visited))))
+
+(time (-main))

(ns lpath
  (:gen-class)
  (:use clojure.pprint))
(require '[clojure.string :as str])

    (let [max (atom (long 0))]
      (dorun (map (fn [#^route neighbour]
                    (if (not (aget visited (.dest neighbour)))
                       (let [dist (+ (.cost neighbour) (long (get-longest-path nodes (.dest neighbour) visited)))]
                        (if (> dist (long @max))
                          (reset! max dist)
                          nil))
                      nil))
