use of nested loop in atmega