added license information to all source files
polished the code a bit