Improved algorithm to search stores