removed debug messages in console
 added some documentation
 fixed warnings