https://9lib.net/document/dy4mk6ry-algorithms-and-the-grid.html