added license header and javadoc comments