more edits to loops