Mesh debug code functions