Major speed up

Major speed up on the brute-force search function.
Revert "Indentation fix"

This reverts commit 5a7e9c6054d855e850fe43c4891a322ddff2d9ee.
Revert back on changes