reorganized for clarity