updated javadoc and added logging