fix comments, format, add license