got rid of for loop