Improved code

* Moved C printf => C++ streams
* Improved comments
* Improved misc specific code