Finish implementing connect()