JavaDoc added

Added a javadoc for this code