add license, comments, and formatting