add license headers and following coding styles