changed debug output method
added comments
added comments and charge&heat code