Changed the PathCountCalculator to be more dynamic.