diff --git a/greedy-algorithms/notes.md b/greedy-algorithms/notes.md
index 09b242b645b7b91e92034af2fa2fb4ab97dd53e8..2e3a406db46d35fb2951df2a96c6296c04c7e8cb 100644
--- a/greedy-algorithms/notes.md
+++ b/greedy-algorithms/notes.md
@@ -55,10 +55,10 @@ Problem: Given a sequence of fueling sites, the distances between consecutive si
 
 ## DAG
 
-*   Vertices (situations):
-    *   Locations
 *   Edges (actions):
     *   Ways to advance to a location up to `range` units of distance away
+*   Vertices (situations):
+    *   Locations
 *   Edge weights (optional):
     *   Distance to the next location
 *   Topological order:
@@ -212,23 +212,23 @@ Problem: Given frequencies for a set of symbols, create a lossless binary encodi
 
 ## DAG
 
-*   Vertices (situations):
-    *   …
 *   Edges (actions):
-    *   …
-*   Edge weights (optional):
-    *   …
+    *   Combine two parts (sets of symbols) and record bits for the combination that we did
+*   Vertices (situations):
+    *   Partitions of the symbols
+*   Edge weights:
+    *   Total frequency of the combined set
 *   Topological order:
-    *   …
+    *   By decreasing number of parts
 *   Goal:
-    *   …
+    *   Find the shortest path from having all sets separated to having all sets combined into one part
 
 ## Choosing a Forward Edge
 
 *   Direct solution:
-    *   …
-    *   …
-    *   …
+    *   Choose the lowest-frequency part
+    *   Choose the second-lowest-frequency part
+    *   Follow the edge that combines those parts
 
 ## Example
 
diff --git a/greedy-algorithms/src/features/fueling/solver.js b/greedy-algorithms/src/features/fueling/solver.js
index 1d81f060bb6b80fb63614420e00c52388bf88566..b97bec004a4201343edfd53cf9000fc8b480be30 100644
--- a/greedy-algorithms/src/features/fueling/solver.js
+++ b/greedy-algorithms/src/features/fueling/solver.js
@@ -11,9 +11,9 @@ export function planFuelings(gaps, range) {
   const destination = gaps.length;
   while (results[results.length - 1] < destination) {
     let best = undefined;
-    for (let distance = …, candidate = …;
-      distance < … && candidate < …;
-      distance += …, candidate += …) {
+    for (let distance = 0, candidate = results[results.length - 1];
+      distance <= range && candidate <= destination;
+      distance += gaps[candidate], ++candidate) {
       best = candidate;
     }
     results.push(best);