exercise with while loop