add license header and javadoc