changed the way we compute edges for table