Now correctly calculating the number of shortest paths