rearranged some comments for clarity