Moved coordinate generation code out of exhaustive search function so search is type neutral