Got rid of for loop