adding documentation
code style cleanup
more comments