Loop exercise solved