CLEANUP: add javadoc, take care of warnings.