cleans the for loops