https://ocaml.codingforstudent.com/the-science-of-how-to-analysis-of-lattice-design/