while function instead of each method 00