extracted connect function from stream
updated README