cleaned up search-example code