Imported triangle_facts solution