Added licence and javadoc comments