looping exercises implemented