Added javadoc and commentaries