Merged in Tremayne's newest search code, reverted to old layout