getting rid of for loop breaks