The code responsible for finding contacts and opening connections