switched max score search to min score search