Improved code.
Fixed documentation and removed useless comments.