fixed compute horizontal score algorithm