Edits with SO for clarity and to loop