Wrote basic connect()