diff --git a/Pipline.md b/Pipline.md
index 609e0db..47fd992 100644
--- a/Pipline.md
+++ b/Pipline.md
@@ -54,8 +54,67 @@ Two points belong to the same cluster only if:
The T-DBSCAN algorithm is optimized with **KD-Tree**, this will help find the nearest points faster, if further optimizations are needed then we should look into improving the **Cash Hits** and maybe change the algorithm to use **SIMD** and **Multi-Threading**.
# Douglas-Peucker Simplification
-Ramer-Douglas-Peucker is an algorithm that decimates a curve composed of line segments to a similar curve with fewer points.
+The Douglas–Peucker Simplification algorithm (often called the Ramer–Douglas–Peucker algorithm) is a technique used in computational geometry to reduce the number of points in a curve or line while preserving its overall shape.
-
+Imagine you have a line made of many points (like a GPS path or a drawn shape). The algorithm removes unnecessary points so the line becomes simpler—but still looks almost the same.
+
+
+
+### Why it's needed?
+Having hours of **GPS records** will slow down OSRM Map Matching, so to speed it up, we reduce and simplify number of points, using line simplification algorithm.
+
+We choosed Ramer-Douglas-Peucker Algorithm as it the most common algorithm but there is other like:
+- Visvalingam–Whyatt
+- Reumann–Witkam
+- Opheim simplification
+- Lang simplification
+- Zhao–Saalfeld
+- Imai-Iri
+
+### How it works (step-by-step)
+
+
+- Start with endpoints
+ - Take the first and last point of the line segment.
+- Find the farthest point
+ - Look for the point between them that is farthest from the straight line connecting the endpoints.
+- Check distance vs tolerance (ε)
+ - If the distance is greater than ε (epsilon) → keep that point and split the line there.
+ - If the distance is less than ε → remove all intermediate points (they’re not important).
+- Repeat recursively
+ - Apply the same process to each new segment.
+
+### Parameter
+- **ε:** Small value will keep more points, Large values will remove more points.
+
+# Map Matching
+**Map Matching** is the process of taking raw geographic data—usually a sequence of GPS points—and **snapping** it onto a known map, like a road network, to figure out the exact path someone actually traveled.
+
+### Why it's needed
+GPS data isn't perfectly accurate, Signals can drift due to buildings, weather, or device limitations, So if you record a trip, your points might look like they jump around or even go off-road. **Map matching corrects this.**
+
+For us Map Matching is handled by OSRM (Open Srouce Route Matching).
+
+### Example
+Imagine your phone records these GPS points while you're driving:
+- Some points fall slightly off the road.
+- A few might even appear on nearby streets.
+
+Map matching analyzes those points and determines `You were actually on this road, following this route`.
+
+### Basic Idea
+It combines:
+- **Geometry:** Distance between GPS poitns and roads.
+- **Topology:** How roads connect.
+- **Movement Logic:** Speed, Direction, and continuity.
+
+Advanced methods use probabilistic models like Hidden Markov Models (HMMs) to guess the most likely path.
+
+# Gap Detections
+GPS records are not perfect, and sometimes you get gaps, so when we do Map Matching you may not get one path, we may get multiple paths, if we get multiple paths it means that we have a gap.
+
+Number of gaps is determined by gap_n = Number_Of_Paths - 1
+
+### How to handle gaps
+Handling gaps is very simple, we take last point from PATH_1, then we take first point from PATH_2, then we run Routing Engine OSRM on these two points. We do this on all gaps.
-# Map Matching
\ No newline at end of file