try to build connection matrix