added javadoc and some default secure functions