More efficient search and sort