added a lot of javadoc
added license headers