Fixed a copy paste errors and filtered out all edges with form (x,x)

Before, there were edges in this form (x,x) included but they shouldn't be included.
Merge pull request #4 from mcwise/patch-1

Fixed a copy paste errors and filtered out all edges with form (x,x)