add some comments, make charset parsing lower()