Added a bit of documentation
Implemented autoreconnection