Add comments and clarify the main script.