Started modifications for connectivity matrix computation