documentation
improved comments; added connect and connect fail