relation builder
prevent duplicate pair
write output to file
fix extension
add test 4
main file