compute_adj.py first working version