writing connections to dictionary