convert search to use comma-ok idiom