run code through netbeans code formatter
refactor and document

* remove some unneeded code
* document a bit
* add overwrite annotations, etc.