Works for connected mesh