Added javadoc to enhance understanding