a lot of changes to JS, and search strcuture