detect the line with the most points and use that as reference line
implement all_ calculations, slightly improve documentation