Steensgaard's algorithm