Added code to remove duplicates & added class comments
Corrected duplicate edge removal