Search function tweeked