added Java doc comments to classes and methods.
fixed merge errors. Deleted some commented lines.