fixing encondig issues and adding license headers to code files