It works by drawing lines in provided it doesn't split the maze into two sections (like an inverse of kruskal's maze generator)