added license, style changes in code and javadoc