diff --git a/examples/core/00_example_template/example.c b/examples/core/00_example_template/example.c
index 10de579..bcb38fd 100644
--- a/examples/core/00_example_template/example.c
+++ b/examples/core/00_example_template/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/examples/core/00_example_template/makefile b/examples/core/00_example_template/makefile
deleted file mode 100644
index ef385f7..0000000
--- a/examples/core/00_example_template/makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c
-OUTPUT=example
-
-## Dependencies
-MATH=-lm
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99
-WARNINGS=-Wall
-OPTIMIZED=-O3  #-Ofast
-# OPENMP=-fopenmp
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	$(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	OMP_NUM_THREADS=1 ./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/core/01_one_sample/example.c b/examples/core/01_one_sample/example.c
index 683414a..82480a9 100644
--- a/examples/core/01_one_sample/example.c
+++ b/examples/core/01_one_sample/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/examples/core/01_one_sample/makefile b/examples/core/01_one_sample/makefile
deleted file mode 100644
index ef385f7..0000000
--- a/examples/core/01_one_sample/makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c
-OUTPUT=example
-
-## Dependencies
-MATH=-lm
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99
-WARNINGS=-Wall
-OPTIMIZED=-O3  #-Ofast
-# OPENMP=-fopenmp
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	$(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	OMP_NUM_THREADS=1 ./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/core/02_many_samples_time_to_botec/makefile b/examples/core/02_many_samples_time_to_botec/makefile
deleted file mode 100644
index 2d251e0..0000000
--- a/examples/core/02_many_samples_time_to_botec/makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c
-OUTPUT=example
-
-## Dependencies
-MATH=-lm
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99
-WARNINGS=-Wall
-OPTIMIZED=-O3  #-Ofast
-# OPENMP=-fopenmp
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	$(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do ./$(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/core/02_many_samples_time_to_botec/example b/examples/core/02_time_to_botec/example
similarity index 100%
rename from examples/core/02_many_samples_time_to_botec/example
rename to examples/core/02_time_to_botec/example
diff --git a/examples/core/02_many_samples_time_to_botec/example.c b/examples/core/02_time_to_botec/example.c
similarity index 97%
rename from examples/core/02_many_samples_time_to_botec/example.c
rename to examples/core/02_time_to_botec/example.c
index 2ddac68..147a02f 100644
--- a/examples/core/02_many_samples_time_to_botec/example.c
+++ b/examples/core/02_time_to_botec/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/examples/core/03_gcc_nested_function/example b/examples/core/03_gcc_nested_function/example
index a513887..961ece4 100755
Binary files a/examples/core/03_gcc_nested_function/example and b/examples/core/03_gcc_nested_function/example differ
diff --git a/examples/core/03_gcc_nested_function/example.c b/examples/core/03_gcc_nested_function/example.c
index 226d94e..dbf9821 100644
--- a/examples/core/03_gcc_nested_function/example.c
+++ b/examples/core/03_gcc_nested_function/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/examples/core/03_gcc_nested_function/makefile b/examples/core/03_gcc_nested_function/makefile
deleted file mode 100644
index 6080f89..0000000
--- a/examples/core/03_gcc_nested_function/makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c
-OUTPUT=example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=gnu99 ## allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/core/06_gamma_beta/example b/examples/core/04_gamma_beta/example
similarity index 100%
rename from examples/core/06_gamma_beta/example
rename to examples/core/04_gamma_beta/example
diff --git a/examples/core/06_gamma_beta/example.c b/examples/core/04_gamma_beta/example.c
similarity index 97%
rename from examples/core/06_gamma_beta/example.c
rename to examples/core/04_gamma_beta/example.c
index 428037c..979c1a8 100644
--- a/examples/core/06_gamma_beta/example.c
+++ b/examples/core/04_gamma_beta/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/examples/core/16_100_lognormal_samples/example b/examples/core/05_hundred_lognormals/example
similarity index 100%
rename from examples/core/16_100_lognormal_samples/example
rename to examples/core/05_hundred_lognormals/example
diff --git a/examples/core/16_100_lognormal_samples/example.c b/examples/core/05_hundred_lognormals/example.c
similarity index 92%
rename from examples/core/16_100_lognormal_samples/example.c
rename to examples/core/05_hundred_lognormals/example.c
index d9e65a5..5b93421 100644
--- a/examples/core/16_100_lognormal_samples/example.c
+++ b/examples/core/05_hundred_lognormals/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/examples/core/16_100_lognormal_samples/run-sorted.sh b/examples/core/05_hundred_lognormals/run-sorted.sh
similarity index 100%
rename from examples/core/16_100_lognormal_samples/run-sorted.sh
rename to examples/core/05_hundred_lognormals/run-sorted.sh
diff --git a/examples/core/06_gamma_beta/makefile b/examples/core/06_gamma_beta/makefile
deleted file mode 100644
index ef385f7..0000000
--- a/examples/core/06_gamma_beta/makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c
-OUTPUT=example
-
-## Dependencies
-MATH=-lm
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99
-WARNINGS=-Wall
-OPTIMIZED=-O3  #-Ofast
-# OPENMP=-fopenmp
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	$(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	OMP_NUM_THREADS=1 ./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/core/16_100_lognormal_samples/makefile b/examples/core/16_100_lognormal_samples/makefile
deleted file mode 100644
index ef385f7..0000000
--- a/examples/core/16_100_lognormal_samples/makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c
-OUTPUT=example
-
-## Dependencies
-MATH=-lm
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99
-WARNINGS=-Wall
-OPTIMIZED=-O3  #-Ofast
-# OPENMP=-fopenmp
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	$(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	OMP_NUM_THREADS=1 ./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/core/makefile b/examples/core/makefile
new file mode 100644
index 0000000..aa782d9
--- /dev/null
+++ b/examples/core/makefile
@@ -0,0 +1,85 @@
+# Interface: 
+# make all 
+# make format-all
+# make run-all
+# make one             DIR=01_one_sample
+# make format-one      DIR=01_one_sample
+# make run-one         DIR=01_one_sample
+# make time-linux-one  DIR=01_one_sample
+# make profile-one     DIR=01_one_sample
+
+# Compiler
+CC=gcc
+# CC=tcc # <= faster compilation
+
+# Main file
+SRC=example.c
+OUTPUT=example
+
+## Dependencies
+SQUIGGLE=../../squiggle.c
+MATH=-lm
+DEPS=$(SQUIGGLE) $(MATH)
+
+## Flags
+DEBUG= #'-g'
+STANDARD=-std=c99
+WARNINGS=-Wall
+OPTIMIZED=-O3  #-Ofast
+
+## Formatter
+STYLE_BLUEPRINT=webkit
+FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
+
+## make all
+all:
+	$(CC) $(OPTIMIZED) $(DEBUG) 00_example_template/$(SRC)    $(DEPS) -o 00_example_template/$(OUTPUT)
+	$(CC) $(OPTIMIZED) $(DEBUG) 01_one_sample/$(SRC)          $(DEPS) -o 01_one_sample/$(OUTPUT)
+	$(CC) $(OPTIMIZED) $(DEBUG) 02_time_to_botec/$(SRC)       $(DEPS) -o 02_time_to_botec/$(OUTPUT)
+	$(CC) $(OPTIMIZED) $(DEBUG) 03_gcc_nested_function/$(SRC) $(DEPS) -o 03_gcc_nested_function/$(OUTPUT)
+	$(CC) $(OPTIMIZED) $(DEBUG) 04_gamma_beta/$(SRC)          $(DEPS) -o 04_gamma_beta/$(OUTPUT)
+	$(CC) $(OPTIMIZED) $(DEBUG) 05_hundred_lognormals/$(SRC)  $(DEPS) -o 05_hundred_lognormals/$(OUTPUT)
+
+format-all:
+	$(FORMATTER) 00_example_template/$(SRC)
+	$(FORMATTER) 01_one_sample/$(SRC)
+	$(FORMATTER) 02_time_to_botec/$(SRC)
+	$(FORMATTER) 03_gcc_nested_function/$(SRC)
+	$(FORMATTER) 04_gamma_beta/$(SRC)
+	$(FORMATTER) 05_hundred_lognormals/$(SRC)
+
+run-all:
+	00_example_template/$(OUTPUT)
+	01_one_sample/$(OUTPUT)
+	02_time_to_botec/$(OUTPUT)
+	03_gcc_nested_function/$(OUTPUT)
+	04_gamma_beta/$(OUTPUT)
+	05_hundred_lognormals/$(OUTPUT)
+	
+## make one DIR=01_one_sample
+one: $(DIR)/$(SRC)
+	$(CC) $(OPTIMIZED) $(DEBUG) $(DIR)/$(SRC) $(DEPS) -o $(DIR)/$(OUTPUT)
+
+## make format-one DIR=01_one_sample
+format-one: $(DIR)/$(SRC)
+	$(FORMATTER) $(DIR)/$(SRC)
+
+## make run-one DIR=01_one_sample
+run-one: $(DIR)/$(OUTPUT)
+	$(DIR)/$(OUTPUT) && echo
+
+## make time-linux-one DIR=01_one_sample
+time-linux-one: $(DIR)/$(OUTPUT)
+	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
+	@echo "Running 100x and taking avg time $(DIR)/$(OUTPUT)"
+	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(DIR)/$(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
+
+## e.g., make profile-linux-one DIR=01_one_sample
+profile-linux-one: 
+	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
+	echo "Must be run as sudo"
+	$(CC) $(OPTIMIZED) $(DEBUG) $(DIR)/$(SRC) $(DEPS) -o $(DIR)/$(OUTPUT)
+	# $(CC) $(SRC) $(DEPS) -o $(OUTPUT)
+	sudo perf record $(DIR)/$(OUTPUT)
+	sudo perf report
+	rm perf.data
diff --git a/examples/more/04_sample_from_cdf_simple/example.c b/examples/more/04_sample_from_cdf_simple/example.c
index d703666..5d3f246 100644
--- a/examples/more/04_sample_from_cdf_simple/example.c
+++ b/examples/more/04_sample_from_cdf_simple/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/05_sample_from_cdf_beta/example.c b/examples/more/05_sample_from_cdf_beta/example.c
index 09f7fd7..706dad0 100644
--- a/examples/more/05_sample_from_cdf_beta/example.c
+++ b/examples/more/05_sample_from_cdf_beta/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/05_sample_from_cdf_beta/makefile b/examples/more/05_sample_from_cdf_beta/makefile
deleted file mode 100644
index c1d84b2..0000000
--- a/examples/more/05_sample_from_cdf_beta/makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-# CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-VERBOSE=#-v
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(VERBOSE) $(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/07_ci_beta/example.c b/examples/more/07_ci_beta/example.c
index 9ca9e6c..a10c075 100644
--- a/examples/more/07_ci_beta/example.c
+++ b/examples/more/07_ci_beta/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <stdint.h>
 #include <stdio.h>
diff --git a/examples/more/07_ci_beta/makefile b/examples/more/07_ci_beta/makefile
deleted file mode 100644
index 821add6..0000000
--- a/examples/more/07_ci_beta/makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-OPENMP=-fopenmp
-MATH=-lm
-DEPENDENCIES=$(MATH) $(OPENMP)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/08_nuclear_war/example.c b/examples/more/08_nuclear_war/example.c
index 1c44880..6cb883c 100644
--- a/examples/more/08_nuclear_war/example.c
+++ b/examples/more/08_nuclear_war/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/08_nuclear_war/makefile b/examples/more/08_nuclear_war/makefile
deleted file mode 100644
index 39acff1..0000000
--- a/examples/more/08_nuclear_war/makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=example
-
-## Dependencies
-MATH=-lm
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99
-WARNINGS=-Wall
-OPTIMIZED=-O3  #-Ofast
-# OPENMP=-fopenmp
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	$(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	OMP_NUM_THREADS=1 ./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/09_burn_10kg_fat/example.c b/examples/more/09_burn_10kg_fat/example.c
index 477cb2f..2184e51 100644
--- a/examples/more/09_burn_10kg_fat/example.c
+++ b/examples/more/09_burn_10kg_fat/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/09_burn_10kg_fat/makefile b/examples/more/09_burn_10kg_fat/makefile
deleted file mode 100644
index 9f5cdc4..0000000
--- a/examples/more/09_burn_10kg_fat/makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/10_nuclear_recovery/example.c b/examples/more/10_nuclear_recovery/example.c
index abbfe8e..8434af6 100644
--- a/examples/more/10_nuclear_recovery/example.c
+++ b/examples/more/10_nuclear_recovery/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/10_nuclear_recovery/makefile b/examples/more/10_nuclear_recovery/makefile
deleted file mode 100644
index 9f5cdc4..0000000
--- a/examples/more/10_nuclear_recovery/makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/11_algebra/example.c b/examples/more/11_algebra/example.c
index a6b6fbd..d621a3a 100644
--- a/examples/more/11_algebra/example.c
+++ b/examples/more/11_algebra/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/11_algebra/makefile b/examples/more/11_algebra/makefile
deleted file mode 100644
index 9f5cdc4..0000000
--- a/examples/more/11_algebra/makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/12_algebra_and_conversion/example.c b/examples/more/12_algebra_and_conversion/example.c
index 9300561..d5fafdd 100644
--- a/examples/more/12_algebra_and_conversion/example.c
+++ b/examples/more/12_algebra_and_conversion/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/12_algebra_and_conversion/makefile b/examples/more/12_algebra_and_conversion/makefile
deleted file mode 100644
index 9f5cdc4..0000000
--- a/examples/more/12_algebra_and_conversion/makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/13_ergonomic_algebra/example.c b/examples/more/13_ergonomic_algebra/example.c
index 35fcfd1..39785fb 100644
--- a/examples/more/13_ergonomic_algebra/example.c
+++ b/examples/more/13_ergonomic_algebra/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <math.h>
 #include <stdint.h>
diff --git a/examples/more/13_ergonomic_algebra/makefile b/examples/more/13_ergonomic_algebra/makefile
deleted file mode 100644
index 9f5cdc4..0000000
--- a/examples/more/13_ergonomic_algebra/makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/14_twitter_thread_example/example.c b/examples/more/14_twitter_thread_example/example.c
index 002f392..ba0f8eb 100644
--- a/examples/more/14_twitter_thread_example/example.c
+++ b/examples/more/14_twitter_thread_example/example.c
@@ -1,4 +1,4 @@
-#include "../../squiggle.h"
+#include "../../../squiggle.h"
 #include "../../squiggle_more.h"
 #include <stdint.h>
 #include <stdio.h>
diff --git a/examples/more/14_twitter_thread_example/makefile b/examples/more/14_twitter_thread_example/makefile
deleted file mode 100644
index 9f5cdc4..0000000
--- a/examples/more/14_twitter_thread_example/makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Interface: 
-#   make
-#   make build
-#   make format
-#   make run
-
-# Compiler
-CC=gcc # required for nested functions
-# CC=tcc # <= faster compilation
-
-# Main file
-SRC=example.c ../../squiggle.c ../../squiggle_more.c
-OUTPUT=./example
-
-## Dependencies
-MATH=-lm
-DEPENDENCIES=$(MATH)
-# OPENMP=-fopenmp
-
-## Flags
-DEBUG= #'-g'
-STANDARD=-std=c99 ## gnu99 allows for nested functions.
-EXTENSIONS= #-fnested-functions
-WARNINGS=-Wall
-OPTIMIZED=-O3#-Ofast
-CFLAGS=$(DEBUG) $(STANDARD) $(EXTENSIONS) $(WARNINGS) $(OPTIMIZED)
-
-## Formatter
-STYLE_BLUEPRINT=webkit
-FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
-
-## make build
-build: $(SRC)
-	# gcc -std=gnu99 example.c -lm -o example
-	$(CC) $(CFLAGS) $(SRC) $(DEPENDENCIES) -o $(OUTPUT)
-
-format: $(SRC)
-	$(FORMATTER) $(SRC)
-
-run: $(SRC) $(OUTPUT)
-	./$(OUTPUT) && echo
-
-time-linux: 
-	@echo "Requires /bin/time, found on GNU/Linux systems" && echo
-	
-	@echo "Running 100x and taking avg time $(OUTPUT)"
-	@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo
-
-## Profiling
-
-profile-linux: 
-	echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar"
-	echo "Must be run as sudo"
-	$(CC) $(SRC) $(MATH) -o $(OUTPUT)
-	sudo perf record ./$(OUTPUT)
-	sudo perf report
-	rm perf.data
diff --git a/examples/more/04_sample_from_cdf_simple/makefile b/examples/more/makefile
similarity index 100%
rename from examples/more/04_sample_from_cdf_simple/makefile
rename to examples/more/makefile