Added the beginnings of the listening threads