Gotten rid of a bunch of for loops