Refactored code to have Edge object/list for future use