Many improvements in the connect() method :100:

Improved the connect() method and added a todo function : disconnect().