changed formatting of output for text files so that there isn't random white space anymore, also changed the patterns so that there wouldn't be any duplicate edges