Add checkEdge method and fix first test