more changes to search plus random tweaks