         page-content))))
 
 (defmethod generate-response :200 [_ res-as-string]
-  (compose (list
+  (compose-list (list
              "HTTP/1.1 200 OK"
              "content-type: text/html; charset=utf-8"
              (format "content-length: %s" (count res-as-string))

             res-as-string)))

(defn run-server [port]
  (println (format "server accepting request on %s" port))
  (loop [server (new ServerSocket port)]
    (let [socket (.accept server)]

(ns inf4375-simple-server.core
  (:gen-class)
  (:import (java.io InputStreamReader PrintWriter BufferedReader)
           (java.net ServerSocket))
  (:require [clojure.string :as str]
            [clojure.pprint :as pp]
            [me.raynes.fs   :as fs]))

(defn consume-buffer [input]
  "Consume a input buffer and gives it content as a list of string"
  (loop  [lines '()]
    (if (.ready input)
      (recur(concat lines (list (.readLine input))))
      (remove (fn [l] (empty? l))lines))))

(defn parse-request [lines]
  "Structure a http requests"
  (let [[request-line & headers] lines
        [method uri version] (str/split request-line #" ")]
    {:request-line
