Updated example to loop more correctly