nearest = n items distance + res ->
  hypotenuse = x1 y1 x2 y2 ->
    sqrt ((x1 - x2) ** 2 +
          (y1 - y2) ** 2)
  ;

  x = items:n.x
  y = items:n.y

  for items i current ->
    if (i != n) ->
      if (d < distance
          ' d = hypotenuse x y current.x current.y) -> 
        attach res current
      else
        <>
      ;
    else
      <>
    ;
  ;
;