loop statements regarding color changing for Chapter-2