adding license headers. + some minor fixes