Added network measures code from Petra