Added extra JavaDoc and inline docs.