Separating out the triangle (transitivity) code into a different file.