Refactored code and created Edge class. Updated vertex class.