add value adding with while loops