Updated with for loop.