changed interface of edge classes for simpler codes.