Implemented Edge.java