Corrected mistake in extractEdges() + added new function commPD()