fix and improve low-dimensional brute-force search