Improved code

* added visibility for all methods
* added comments