Changes made to compute cost of paths found.