Changed the loop