anchor.diff:      }
       match peer with
       | None ->
  -        node
  +        start_listening node
       | Some(peer) ->
           match send_message peer guid Join address with
  -        | None -> failwith (sprintf "Could not establish a connection with peer at '%s'" peer)
  +        | None ->
  +            failwith (sprintf "Could not establish a connection with peer at '%s'" peer)
           | Some(_) ->
  -            node
  -
  -let send (node: Node) (msg: string) (address: Address) =
  -    0
  -
  -let forward (node: Node) (msg: string) (dst: GUID) =
  -    0
  +            start_listening node
   
   // Adapted from https://stackoverflow.com/questions/1069103/how-to-get-my-own-ip-address-in-c
   let get_public_ip () =
  
positive.code: let split (str: string) (c: char) =
      List.ofArray (str.Split([|c|]))
  
  // Messages
  // Join: join address
  // Routes a message somewhere
  let route (node: Node) (msg: string) (key: GUID) =
      // I'll just write this one... god knows where it should all go
      //if
      0
  
  // Send messages to the other pastry nodes that this has been created
  let finalize_initialisation (node: Node) =
      0
  
  // Sends a join message to find the key closest to the GUID of the new node,
  // appending the state tables of all nodes on the way before returning it
  let send_join_message (new_node: GUID, address: Address, data: string) =
      0
  
  let listen_until_initialized (node: Node) =
      0
  
  // Convert a byte array to an u64. Please don't use an array that is more than
  // 8 bytes long... (tip: You get undefined behavior)
  let to_u64 (byte_arr: byte[]) = // It's this or mapi + foldback ...
      let rec inner arr pos acc =
          match arr with
          | [] -> acc
          | x::xs -> // Use bit shifts to add the correct value
              inner xs (pos - 1) (acc + ((uint64 x) <<< (8 * pos)))
      let res: uint64 = 0UL
      inner (Array.toList byte_arr) (byte_arr.Length - 1) res
  
  // Converts an IP-address (or any other string) to an u128 (sorta)
  let hash (ip_address: NetworkLocation): U128 =
      let content: byte[] = System.Text.Encoding.ASCII.GetBytes(ip_address)
      let bytes: byte[] = (content |> HashAlgorithm.Create("SHA1").ComputeHash).[..15] // 16 first bytes
      let a = to_u64 bytes.[..7]
      let b = to_u64 bytes.[8..15]
      (a, b)
  
  let listen node =
      // Listen for a a message
      use listener = new System.Net.HttpListener ()
      listener.Prefixes.Add "http://localhost:8080/"
      listener.Start ()
      let cxt      = listener.GetContext()
      let request  = cxt.Request
      let response = cxt.Response
      let meth     = request.HttpMethod
      let args     = request.QueryString
      let path     = request.Url.AbsolutePath
      let rip      = request.RemoteEndPoint.Address
      let rport    = request.RemoteEndPoint.Port
      let body =
          use is = new System.IO.StreamReader(request.InputStream, request.ContentEncoding)
          is.ReadToEnd()
      printfn "Path: %s" path
  
      // Now interpret what was received
  
  
  let send_message (address: NetworkLocation) (destination: U128) (typ: MessageType) (data: string) =
      try
          let cmd =
  
negative.code:     with
          | ex -> None
  
  // Replies to a http request
  let reply (response: HttpListenerResponse) answer status reason =
      printfn " --> %d %s [%s]" status reason answer
      // Set HTTP statuscode and reason (e.g., 200 OK)
      response.StatusCode <- status
      response.StatusDescription <- reason
      // Encode and write body.
      let buffer = System.Text.Encoding.UTF8.GetBytes(answer : string)
      response.ContentLength64 <- int64 buffer.Length;
      response.OutputStream.Write(buffer,0,buffer.Length);
      response.OutputStream.Close();
  
  // Messages
  // Join: join address
  // Routes a message somewhere
  let route (node: Node) (typ: MessageType) (msg: string) (key: GUID) =
      // I'll just write this one... god knows where it should all go
      //if
      node
  
  // Convert a byte array to an u64. Please don't use an array that is more than
  // 8 bytes long... (tip: You get undefined behavior)
  let to_u64 (byte_arr: byte[]) = // It's this or mapi + foldback ...
      let rec inner arr pos acc =
          match arr with
          | [] -> acc
          | x::xs -> // Use bit shifts to add the correct value
              inner xs (pos - 1) (acc + ((uint64 x) <<< (8 * pos)))
      let res: uint64 = 0UL
      inner (Array.toList byte_arr) (byte_arr.Length - 1) res
  
  // Converts an IP-address (or any other string) to an u128 (sorta)
  let hash (ip_address: NetworkLocation): U128 =
      let content: byte[] = System.Text.Encoding.ASCII.GetBytes(ip_address)
      let bytes: byte[] = (content |> HashAlgorithm.Create("SHA1").ComputeHash).[..15] // 16 first bytes
      let a = to_u64 bytes.[..7]
      let b = to_u64 bytes.[8..15]
      (a, b)
  
  // Just a little formatting
  let error str =
      printfn "ERROR: %s" str
  
  // Makes the given pastry node start listening...
  let start_listening (node: Node) =
      printfn "Initializing..."
      use listener = new System.Net.HttpListener ()
      listener.Prefixes.Add "http://localhost:8080/"
      listener.Start ()
  
      printfn "Listening..."
  
      let rec listen (node: Node) =
          // Listen for a a message
  
          let cxt      = listener.GetContext()
          let request  = cxt.Request
          let response = cxt.Response
          let meth     = request.HttpMethod
          let args     = request.QueryString
          let path     = request.Url.AbsolutePath
          let rip      = request.RemoteEndPoint.Address
          let rport    = request.RemoteEndPoint.Port
          let body =
              use is = new System.IO.StreamReader(request.InputStream, request.ContentEncoding)
              is.ReadToEnd()
          printfn "Path: %s" path
          let parts = split (path.[1..]) '/' // That annoying first slash...
          printfn "Parts: %A" parts
          // Now interpret what was received
          let (updated_node, answer, status, reason) =
              match parts with
              | "pastry"::cmd::dst ->
                  printfn "%A" route
                  match cmd with
                  | "join"    ->
                      node, "Unsupported", 404, "Not Found" //route node Join cmd dst body
                  | "update"  ->
                      node, "Unsupported", 404, "Not Found" //route node Update cmd dst body
                  | "route"   ->
                      node, "Unsupported", 404, "Not Found" //route node Route cmd dst body
                  | _         ->
                      error <| sprintf "Received bad pastry command: '%s'" cmd
                      node, (sprintf "Bad pastry command: '%s'" cmd), 400, "Not Found"
  
              | "pastry"::stuff -> // only handles '/pastry'
                  error <| sprintf "Bad pastry request url gotten: %s" path
                  node, (sprintf "Unrecognized pastry request url: '%s'" path), 400, "Illegal action"
              | _ ->
                  error <| sprintf "Got something not related to pastry: %s" path
                  node, (sprintf "Not related to pastry: %s" path), 404, "Not found"
          reply response answer status reason
          listen updated_node // Listen again
  
      listen node // Start listening
  
  // Creates a local node and makes it join the Pastry network
  let join_network (address: NetworkLocation) (peer: NetworkLocation option): Node =
      let guid = hash address
  