added license headers and javadoc