Fixed #4, implemented connect