replaced until and each loops with 9.times loop