Added Javadoc.
Also reformatted the whole code for unicity.