Added the break parts ffor the for loops