Implemented the beta version of Listener (the class that deals with the socket connection)