added path overrides notation and a little more to the shortest path
function