fix missing include
diff --git a/.gitignore b/.gitignore
index d556ffd..7dde577 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,6 @@
 out
 node_modules
 mason_packages
+.toolchain
+.mason
+local.env
\ No newline at end of file
diff --git a/include/delaunator.hpp b/include/delaunator.hpp
index a0f8121..2497e5e 100644
--- a/include/delaunator.hpp
+++ b/include/delaunator.hpp
@@ -7,6 +7,7 @@
 #include <utility>
 #include <cmath>
 #include <iostream>
+#include <algorithm>
 
 namespace delaunator {
 
@@ -18,7 +19,7 @@
     const double dy = ay - by;
     return dx * dx + dy * dy;
 }
-    
+
 inline double circumradius(const double ax,
                            const double ay,
                            const double bx,
@@ -95,17 +96,17 @@
 }
 
 struct sort_to_center {
-    
+
     std::vector<double> const& coords;
     double cx;
     double cy;
-    
+
     bool operator() (std::size_t i, std::size_t j) {
         return compare(coords, i, j, cx, cy) < 0;
     }
 };
 
-inline bool in_circle(double ax, 
+inline bool in_circle(double ax,
                       double ay,
                       double bx,
                       double by,
@@ -165,10 +166,10 @@
         m_hull(),
         m_center_x(),
         m_center_y(),
-        m_hash_size() 
+        m_hash_size()
     {
         std::size_t n = coords.size() >> 1;
-        
+
         double max_x = std::numeric_limits<double>::min();
         double max_y = std::numeric_limits<double>::min();
         double min_x = std::numeric_limits<double>::max();
@@ -184,13 +185,13 @@
             if (y < min_y) min_y = y;
             if (x > max_x) max_x = x;
             if (y > max_y) max_y = y;
-            
+
             ids.push_back(i);
         }
         const double cx = (min_x + max_x) / 2;
         const double cy = (min_y + max_y) / 2;
         double min_dist = std::numeric_limits<double>::max();
-        
+
         std::size_t i0;
         std::size_t i1;
         std::size_t i2;
@@ -392,7 +393,7 @@
         }
 
     }
-    
+
     std::size_t remove_node(std::size_t node) {
         m_hull[m_hull[node].prev].next = m_hull[node].next;
         m_hull[m_hull[node].next].prev = m_hull[node].prev;