improve comments and add license