Added the javadoc and some helper methods.