New exercise with the foreach function