add License header for new source code
Fix coding style to be more readable