How to create the same node from two different columns and create relationships,

Hi,

I am trying to load data from a csv file with two columns of people and I want to capture the relationship between them if they are on the same row. I cannot figure out how to create the same node even if the person appears in different columns:

|Person| Friend|
|Joe Bloggs| Jane Bloggs|
|Jane Bloggs| John H|

so Jane Bloggs should only appear as one node.

I got to this point but this will create two different nodes for Jane:

LOAD CSV WITH HEADERS FROM "file:///friends.csv" as friends
WITH friends
WHERE friends.Person IS NOT NULL
MERGE (p:person {Name:friends.Person})
MERGE (f:friend {Name:friends.Friend})
MERGE (p)-[:knows]->(f)