This can probably be taken out of the for loop.