Exhaustive search somewhat implemented however crashes sometimes