Very cool! How much is it affected by the method of new pin selection after each time we add a line? I.e. currently you are doing oldPin = bestPin, and the first pin is selected at random... wouldn't it be better to just add lines based on a Hough transform (with rounding to the nearest pins) - starting from the line which covers the maximum number of points, and going down?