Fixed documentation (comments) and layout.

Some unused code removel.