Optimizing the code for only going through what was necessary