Modify algorithm for searching objects.