   def process(pOrigin, pPoints, pResultCount) do
     pPoints
     |> Enum.map(&subtractPoint(&1, pOrigin))
-    |> Enum.map(&distanceFromOrigin/1)
+    |> Enum.map(&distanceSquaredFromOrigin/1)
     |> Enum.zip(pPoints)
     |> Enum.sort(fn {distanceA,_pa}, {distanceB,_pb} -> distanceA <= distanceB end)
     |> Enum.map(fn {_distance, point} -> point end)

#   The output can be in any order.

# A single file solution written in Elixir follows.
# To see a list of the command line arguments, run the following.
# This that solution also support working with N-dimensional points,
# and the origin can be specified from the command line.
#   chmod +x closest_points.exs
#   ./closest_points.exs --help
# Examples:

    |> Enum.map(fn {a, b} -> a - b end)
  end

  def distanceSquaredFromOrigin(pPoint) do
    pPoint
    |> Enum.reduce(0, fn value, total -> total + value*value end)
  end
