minor cleanup of search script