Added the connect() function