added license file
+ some code reindentation