add licences and some javadocs