Reorganize and add comments.