Minor refactoring for solution 8

Sped the search up slightly