Added some comments and modified the reconnect function.
Replaced the console output with a trace output. Using trace listener to pipe it to the console is now the preffered method.
Removed some useless comments and added a trace listener to the client.