basic procedures used for network analysis code