with while loop